Interface EPEventService
- All Superinterfaces:
EPEventServiceRouteEvent
,EPEventServiceSendEvent
,EPEventServiceTimeControl
- All Known Subinterfaces:
EPStageEventService
-
Method Summary
Modifier and TypeMethodDescriptiongetEventSender
(String eventTypeName) Returns a facility to process event objects that are of a known type.long
Number of events evaluated over the lifetime of the event stream processing runtime, or since the last resetStats() call.void
Reset the count of the number of events received and emittedvoid
setUnmatchedListener
(UnmatchedListener listener) Sets a listener to receive events that are unmatched by any statement.Methods inherited from interface com.espertech.esper.runtime.client.EPEventServiceRouteEvent
routeEventAvro, routeEventBean, routeEventJson, routeEventMap, routeEventObjectArray, routeEventXMLDOM
Methods inherited from interface com.espertech.esper.runtime.client.EPEventServiceSendEvent
sendEventAvro, sendEventBean, sendEventJson, sendEventMap, sendEventObjectArray, sendEventXMLDOM
Methods inherited from interface com.espertech.esper.runtime.client.EPEventServiceTimeControl
advanceTime, advanceTimeSpan, advanceTimeSpan, clockExternal, clockInternal, getCurrentTime, getNextScheduledTime, isExternalClockingEnabled
-
Method Details
-
getEventSender
Returns a facility to process event objects that are of a known type.Given an event type name this method returns a sender that allows to send in event objects of that type. The event objects send in via the event sender are expected to match the event type, thus the event sender does not inspect the event object other then perform basic checking.
For events backed by a Java class (JavaBean events), the sender ensures that the object send in matches in class, or implements or extends the class underlying the event type for the given event type name. Note that event type identity for Java class events is the Java class. When assigning two different event type names to the same Java class the names are an alias for the same event type i.e. there is always a single event type to represent a given Java class.
For events backed by a Object[] (Object-array events), the sender does not perform any checking other then checking that the event object indeed is an array of object.
For events backed by a java.util.Map (Map events), the sender does not perform any checking other then checking that the event object indeed implements Map.
For events backed by a org.w3c.Node (XML DOM events), the sender checks that the root element name indeed does match the root element name for the event type name.
- Parameters:
eventTypeName
- is the name of the event type- Returns:
- sender for fast-access processing of event objects of known type (and content)
- Throws:
EventTypeException
- thrown to indicate that the name does not exist
-
setUnmatchedListener
Sets a listener to receive events that are unmatched by any statement.Events that can be unmatched are all events that are send into a runtime via one of the sendEvent methods, or that have been generated via insert-into clause.
For an event to be unmatched by any statement, the event must not match any statement's event stream filter criteria (a where-clause is NOT a filter criteria for a stream, as below).
Note: In the following statement a MyEvent event does always match this statement's event stream filter criteria, regardless of the value of the 'quantity' property.
select * from MyEvent where quantity > 5
In the following statement only a MyEvent event with a 'quantity' property value of 5 or less does not match this statement's event stream filter criteria:select * from MyEvent(quantity > 5)
For patterns, if no pattern sub-expression is active for such event, the event is also unmatched.
- Parameters:
listener
- is the listener to receive notification of unmatched events, or null to unregister a previously registered listener
-
getNumEventsEvaluated
long getNumEventsEvaluated()Number of events evaluated over the lifetime of the event stream processing runtime, or since the last resetStats() call.- Returns:
- number of events received
-
resetStats
void resetStats()Reset the count of the number of events received and emitted
-