Class EPEventServiceImpl

java.lang.Object
com.espertech.esper.runtime.internal.kernel.service.EPEventServiceImpl
All Implemented Interfaces:
com.espertech.esper.common.internal.context.util.InternalEventRouteDest, com.espertech.esper.common.internal.event.core.EventServiceSendEventCommon, com.espertech.esper.common.internal.event.util.EPRuntimeEventProcessWrapped, EPEventService, EPEventServiceRouteEvent, EPEventServiceSendEvent, EPEventServiceTimeControl, EPEventServiceQueueProcessor, EPEventServiceSPI, TimerCallback

public class EPEventServiceImpl extends Object implements EPEventServiceSPI, com.espertech.esper.common.internal.context.util.InternalEventRouteDest, TimerCallback, com.espertech.esper.common.internal.event.util.EPRuntimeEventProcessWrapped, EPEventServiceQueueProcessor
Implements runtime interface. Also accepts timer callbacks for synchronizing time events with regular events sent in.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected static final org.slf4j.Logger
     
    static final int
     
     
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    advanceTime(long time)
    Advance time by jumping to the given time in milliseconds (or nanoseconds if so configured).
    void
    advanceTimeSpan(long targetTime)
    Advance time by continually-sliding to the given time in milliseconds (or nanoseconds if so configured) at the smallest resolution (non-hopping).
    void
    advanceTimeSpan(long targetTime, long resolution)
    Advance time by continually-sliding to the given time in milliseconds (or nanoseconds if so configured) at the provided resolution (hopping).
    void
     
    void
    Switches off the internal timer which tracks system time.
    void
    Switches on the internal timer which tracks system time.
    void
    Destroy for destroying an runtime instance: sets references to null and clears thread-locals
    void
    Dispatch events.
    long
    Returns current engine time.
    com.espertech.esper.common.client.EventSender
    getEventSender(String eventTypeName)
    Returns a facility to process event objects that are of a known type.
    Returns the time at which the next schedule execution is expected, returns null if no schedule execution is outstanding.
    long
    Number of events evaluated over the lifetime of the event stream processing runtime, or since the last resetStats() call.
    long
     
    long
     
     
     
    Map<com.espertech.esper.common.internal.util.DeploymentIdNamePair,Long>
     
     
    protected void
    handleFilterFault(com.espertech.esper.common.internal.context.util.EPStatementAgentInstanceHandle faultingHandle, com.espertech.esper.common.client.EventBean theEvent, int filterFaultCount)
     
    void
     
    boolean
    Returns true for external clocking, false for internal clocking.
    protected void
    processMatches(com.espertech.esper.common.client.EventBean theEvent)
     
    void
    processScheduleHandles(com.espertech.esper.common.internal.collection.ArrayBackedCollection<com.espertech.esper.common.internal.schedule.ScheduleHandle> handles)
     
    void
    processStatementFilterMultiple(com.espertech.esper.common.internal.context.util.EPStatementAgentInstanceHandle handle, Object callbackList, com.espertech.esper.common.client.EventBean theEvent, long version, int filterFaultCount)
    Processing multiple filter matches for a statement.
    void
    processStatementFilterSingle(com.espertech.esper.common.internal.context.util.EPStatementAgentInstanceHandle handle, com.espertech.esper.common.internal.context.util.EPStatementHandleCallbackFilter handleCallback, com.espertech.esper.common.client.EventBean theEvent, long version, int filterFaultCount)
    Process a single match.
    void
    Works off the thread's work queue.
    void
    processThreadWorkQueueLatchedSpin(com.espertech.esper.common.internal.statement.insertintolatch.InsertIntoLatchSpin insertIntoLatch)
     
    void
    processThreadWorkQueueLatchedWait(com.espertech.esper.common.internal.statement.insertintolatch.InsertIntoLatchWait insertIntoLatch)
     
    void
     
    void
    processWrappedEvent(com.espertech.esper.common.client.EventBean eventBean)
     
    void
    Reset the count of the number of events received and emitted
    void
    route(com.espertech.esper.common.client.EventBean theEvent, com.espertech.esper.common.internal.context.util.EPStatementHandle epStatementHandle, boolean addToFront, int precedence)
     
    void
    routeEventAvro(Object avroGenericDataDotRecord, String eventTypeName)
    Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent.
    void
    routeEventBean(com.espertech.esper.common.client.EventBean theEvent)
     
    void
    routeEventBean(Object event, String eventTypeName)
    Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent.
    void
    routeEventJson(String json, String eventTypeName)
    Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent.
    void
    routeEventMap(Map<String,Object> map, String eventTypeName)
    Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent.
    void
    routeEventObjectArray(Object[] event, String eventTypeName)
    Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent.
    void
    routeEventXMLDOM(Node event, String eventTypeName)
    Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent.
    void
    sendEventAvro(Object avroGenericDataDotRecord, String avroEventTypeName)
    Send an event represented by a Avro GenericData.Record to the runtime.
    void
    sendEventBean(Object theEvent, String eventTypeName)
    Send an event represented by an object to the runtime.
    void
    sendEventJson(String json, String jsonEventTypeName)
    Send an event represented by a String JSON to the runtime.
    void
    sendEventMap(Map<String,Object> map, String mapEventTypeName)
    Send a map containing event property values to the runtime.
    void
    sendEventObjectArray(Object[] propertyValues, String eventTypeName)
    Send an object array containing event property values to the runtime.
    void
    sendEventXMLDOM(Node node, String eventTypeName)
    Send an event represented by a DOM node to the runtime.
    void
    setInternalEventRouter(com.espertech.esper.common.internal.context.util.InternalEventRouter internalEventRouter)
    Sets the route for events to use
    void
    Sets a listener to receive events that are unmatched by any statement.
    void
    Invoked by the internal clocking service at regular intervals.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • EPEventServiceImpl

      public EPEventServiceImpl(EPServicesContext services)
      Constructor.
      Parameters:
      services - - references to services
  • Method Details

    • getServices

      public EPServicesContext getServices()
    • setInternalEventRouter

      public void setInternalEventRouter(com.espertech.esper.common.internal.context.util.InternalEventRouter internalEventRouter)
      Sets the route for events to use
      Specified by:
      setInternalEventRouter in interface com.espertech.esper.common.internal.context.util.InternalEventRouteDest
      Parameters:
      internalEventRouter - router
    • getRoutedInternal

      public long getRoutedInternal()
      Specified by:
      getRoutedInternal in interface EPEventServiceSPI
    • getRoutedExternal

      public long getRoutedExternal()
      Specified by:
      getRoutedExternal in interface EPEventServiceSPI
    • timerCallback

      public void timerCallback()
      Description copied from interface: TimerCallback
      Invoked by the internal clocking service at regular intervals.
      Specified by:
      timerCallback in interface TimerCallback
    • sendEventAvro

      public void sendEventAvro(Object avroGenericDataDotRecord, String avroEventTypeName)
      Description copied from interface: EPEventServiceSendEvent
      Send an event represented by a Avro GenericData.Record to the runtime.

      Use the route method for sending events into the runtime from within UpdateListener code, to avoid the possibility of a stack overflow due to nested calls to sendEvent (except with the outbound-threading configuration), see EPEventServiceRouteEvent.routeEventAvro(Object, String)}).

      Specified by:
      sendEventAvro in interface EPEventServiceSendEvent
      Specified by:
      sendEventAvro in interface com.espertech.esper.common.internal.event.core.EventServiceSendEventCommon
      Parameters:
      avroGenericDataDotRecord - is the event to sent to the runtime
      avroEventTypeName - event type name
    • sendEventJson

      public void sendEventJson(String json, String jsonEventTypeName)
      Description copied from interface: EPEventServiceSendEvent
      Send an event represented by a String JSON to the runtime.

      Use the route method for sending events into the runtime from within UpdateListener code, to avoid the possibility of a stack overflow due to nested calls to sendEvent (except with the outbound-threading configuration), see EPEventServiceRouteEvent.routeEventJson(String, String)}).

      Specified by:
      sendEventJson in interface EPEventServiceSendEvent
      Parameters:
      json - is the event to sent to the runtime
      jsonEventTypeName - event type name
    • sendEventBean

      public void sendEventBean(Object theEvent, String eventTypeName)
      Description copied from interface: EPEventServiceSendEvent
      Send an event represented by an object to the runtime.

      Use the route method for sending events into the runtime from within UpdateListener code, to avoid the possibility of a stack overflow due to nested calls to sendEvent (except with the outbound-threading configuration), see EPEventServiceRouteEvent.routeEventBean(Object, String).

      Specified by:
      sendEventBean in interface EPEventServiceSendEvent
      Specified by:
      sendEventBean in interface com.espertech.esper.common.internal.event.core.EventServiceSendEventCommon
      Parameters:
      theEvent - is the event to sent to the runtime
      eventTypeName - event type name
    • advanceTime

      public void advanceTime(long time)
      Description copied from interface: EPEventServiceTimeControl
      Advance time by jumping to the given time in milliseconds (or nanoseconds if so configured).

      For externally controlling the time within a runtime.

      External clocking must be first be enabled by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean) passing false or by calling EPEventServiceTimeControl.clockExternal().

      Time should never move backwards (unless for testing purposes where previous results can be thrown away)

      Specified by:
      advanceTime in interface EPEventServiceTimeControl
      Parameters:
      time - time
    • advanceTimeSpan

      public void advanceTimeSpan(long targetTime)
      Description copied from interface: EPEventServiceTimeControl
      Advance time by continually-sliding to the given time in milliseconds (or nanoseconds if so configured) at the smallest resolution (non-hopping).

      For externally controlling the time within a runtime.

      External clocking must be first be enabled by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean) passing false or by calling EPEventServiceTimeControl.clockExternal().

      Time should never move backwards (unless for testing purposes where previous results can be thrown away)

      Specified by:
      advanceTimeSpan in interface EPEventServiceTimeControl
      Parameters:
      targetTime - time
    • advanceTimeSpan

      public void advanceTimeSpan(long targetTime, long resolution)
      Description copied from interface: EPEventServiceTimeControl
      Advance time by continually-sliding to the given time in milliseconds (or nanoseconds if so configured) at the provided resolution (hopping).

      For externally controlling the time within a runtime.

      External clocking must be first be enabled by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean) passing false or by calling EPEventServiceTimeControl.clockExternal().

      Time should never move backwards (unless for testing purposes where previous results can be thrown away)

      Specified by:
      advanceTimeSpan in interface EPEventServiceTimeControl
      Parameters:
      targetTime - time
      resolution - the resolution to use
    • getNextScheduledTime

      public Long getNextScheduledTime()
      Description copied from interface: EPEventServiceTimeControl
      Returns the time at which the next schedule execution is expected, returns null if no schedule execution is outstanding.
      Specified by:
      getNextScheduledTime in interface EPEventServiceTimeControl
      Returns:
      time of next schedule if any
    • sendEventXMLDOM

      public void sendEventXMLDOM(Node node, String eventTypeName)
      Description copied from interface: EPEventServiceSendEvent
      Send an event represented by a DOM node to the runtime.

      Use the route method for sending events into the runtime from within UpdateListener code. to avoid the possibility of a stack overflow due to nested calls to sendEvent (except with the outbound-threading configuration), see EPEventServiceRouteEvent.routeEventXMLDOM(Node, String).

      Specified by:
      sendEventXMLDOM in interface EPEventServiceSendEvent
      Specified by:
      sendEventXMLDOM in interface com.espertech.esper.common.internal.event.core.EventServiceSendEventCommon
      Parameters:
      node - is the DOM node as an event
      eventTypeName - event type name
    • sendEventObjectArray

      public void sendEventObjectArray(Object[] propertyValues, String eventTypeName) throws com.espertech.esper.common.client.EPException
      Description copied from interface: EPEventServiceSendEvent
      Send an object array containing event property values to the runtime.

      Use the route method for sending events into the runtime from within UpdateListener code. to avoid the possibility of a stack overflow due to nested calls to sendEvent (except with the outbound-threading configuration), see EPEventServiceRouteEvent.routeEventObjectArray(Object[], String).

      Specified by:
      sendEventObjectArray in interface EPEventServiceSendEvent
      Specified by:
      sendEventObjectArray in interface com.espertech.esper.common.internal.event.core.EventServiceSendEventCommon
      Parameters:
      propertyValues - - array that contains event property values. Your application must ensure that property values match the exact same order that the property names and types have been declared, and that the array length matches the number of properties declared.
      eventTypeName - - event type name
      Throws:
      com.espertech.esper.common.client.EPException - - when the processing of the event leads to an error
    • sendEventMap

      public void sendEventMap(Map<String,Object> map, String mapEventTypeName) throws com.espertech.esper.common.client.EPException
      Description copied from interface: EPEventServiceSendEvent
      Send a map containing event property values to the runtime.

      Use the route method for sending events into the runtime from within UpdateListener code. to avoid the possibility of a stack overflow due to nested calls to sendEvent (except with the outbound-threading configuration), see EPEventServiceRouteEvent.routeEventMap(java.util.Map, String)).

      Specified by:
      sendEventMap in interface EPEventServiceSendEvent
      Specified by:
      sendEventMap in interface com.espertech.esper.common.internal.event.core.EventServiceSendEventCommon
      Parameters:
      map - - map that contains event property values. Keys are expected to be of type String while values can be of any type. Keys and values should match those declared via Configuration for the given eventTypeName.
      mapEventTypeName - - event type name
      Throws:
      com.espertech.esper.common.client.EPException - - when the processing of the event leads to an error
    • routeEventBean

      public void routeEventBean(com.espertech.esper.common.client.EventBean theEvent)
      Specified by:
      routeEventBean in interface com.espertech.esper.common.internal.event.util.EPRuntimeEventProcessWrapped
    • route

      public void route(com.espertech.esper.common.client.EventBean theEvent, com.espertech.esper.common.internal.context.util.EPStatementHandle epStatementHandle, boolean addToFront, int precedence)
      Specified by:
      route in interface com.espertech.esper.common.internal.context.util.InternalEventRouteDest
    • processWrappedEvent

      public void processWrappedEvent(com.espertech.esper.common.client.EventBean eventBean)
      Specified by:
      processWrappedEvent in interface com.espertech.esper.common.internal.event.util.EPRuntimeEventProcessWrapped
    • processThreadWorkQueue

      public void processThreadWorkQueue()
      Works off the thread's work queue.
      Specified by:
      processThreadWorkQueue in interface com.espertech.esper.common.internal.context.util.InternalEventRouteDest
    • processThreadWorkQueueLatchedWait

      public void processThreadWorkQueueLatchedWait(com.espertech.esper.common.internal.statement.insertintolatch.InsertIntoLatchWait insertIntoLatch)
      Specified by:
      processThreadWorkQueueLatchedWait in interface EPEventServiceQueueProcessor
    • processThreadWorkQueueLatchedSpin

      public void processThreadWorkQueueLatchedSpin(com.espertech.esper.common.internal.statement.insertintolatch.InsertIntoLatchSpin insertIntoLatch)
      Specified by:
      processThreadWorkQueueLatchedSpin in interface EPEventServiceQueueProcessor
    • processThreadWorkQueueUnlatched

      public void processThreadWorkQueueUnlatched(Object item)
      Specified by:
      processThreadWorkQueueUnlatched in interface EPEventServiceQueueProcessor
    • processMatches

      protected void processMatches(com.espertech.esper.common.client.EventBean theEvent)
    • processStatementFilterMultiple

      public void processStatementFilterMultiple(com.espertech.esper.common.internal.context.util.EPStatementAgentInstanceHandle handle, Object callbackList, com.espertech.esper.common.client.EventBean theEvent, long version, int filterFaultCount)
      Processing multiple filter matches for a statement.
      Parameters:
      handle - statement handle
      callbackList - object containing callbacks
      theEvent - to process
      version - filter version
      filterFaultCount - filter fault count
    • processStatementFilterSingle

      public void processStatementFilterSingle(com.espertech.esper.common.internal.context.util.EPStatementAgentInstanceHandle handle, com.espertech.esper.common.internal.context.util.EPStatementHandleCallbackFilter handleCallback, com.espertech.esper.common.client.EventBean theEvent, long version, int filterFaultCount)
      Process a single match.
      Parameters:
      handle - statement
      handleCallback - callback
      theEvent - event to indicate
      version - filter version
      filterFaultCount - filter fault count
    • handleFilterFault

      protected void handleFilterFault(com.espertech.esper.common.internal.context.util.EPStatementAgentInstanceHandle faultingHandle, com.espertech.esper.common.client.EventBean theEvent, int filterFaultCount)
    • dispatch

      public void dispatch()
      Dispatch events.
      Specified by:
      dispatch in interface com.espertech.esper.common.internal.context.util.InternalEventRouteDest
    • isExternalClockingEnabled

      public boolean isExternalClockingEnabled()
      Description copied from interface: EPEventServiceTimeControl
      Returns true for external clocking, false for internal clocking.
      Specified by:
      isExternalClockingEnabled in interface EPEventServiceTimeControl
      Returns:
      clocking indicator
    • destroy

      public void destroy()
      Destroy for destroying an runtime instance: sets references to null and clears thread-locals
      Specified by:
      destroy in interface EPEventServiceSPI
    • initialize

      public void initialize()
      Specified by:
      initialize in interface EPEventServiceSPI
    • clearCaches

      public void clearCaches()
      Specified by:
      clearCaches in interface EPEventServiceSPI
    • setUnmatchedListener

      public void setUnmatchedListener(UnmatchedListener listener)
      Description copied from interface: EPEventService
      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.

      Specified by:
      setUnmatchedListener in interface EPEventService
      Parameters:
      listener - is the listener to receive notification of unmatched events, or null to unregister a previously registered listener
    • getCurrentTime

      public long getCurrentTime()
      Description copied from interface: EPEventServiceTimeControl
      Returns current engine time.

      If time is provided externally via timer events, the function returns current time as externally provided.

      Specified by:
      getCurrentTime in interface EPEventServiceTimeControl
      Returns:
      current engine time
    • getRuntimeURI

      public String getRuntimeURI()
      Specified by:
      getRuntimeURI in interface com.espertech.esper.common.internal.context.util.InternalEventRouteDest
    • processScheduleHandles

      public void processScheduleHandles(com.espertech.esper.common.internal.collection.ArrayBackedCollection<com.espertech.esper.common.internal.schedule.ScheduleHandle> handles)
    • routeEventMap

      public void routeEventMap(Map<String,Object> map, String eventTypeName)
      Description copied from interface: EPEventServiceRouteEvent
      Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent. The route event is processed just like it was sent to the runtime, that is any active expressions seeking that event receive it. The routed event has priority over other events sent to the runtime. In a single-threaded application the routed event is processed before the next event is sent to the runtime.

      Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.

      Specified by:
      routeEventMap in interface EPEventServiceRouteEvent
      Parameters:
      map - to route internally for processing by the runtime
      eventTypeName - event type name
    • routeEventBean

      public void routeEventBean(Object event, String eventTypeName)
      Description copied from interface: EPEventServiceRouteEvent
      Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent. The route event is processed just like it was sent to the runtime, that is any active expressions seeking that event receive it. The routed event has priority over other events sent to the runtime. In a single-threaded application the routed event is processed before the next event is sent to the runtime.

      Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.

      Specified by:
      routeEventBean in interface EPEventServiceRouteEvent
      Parameters:
      event - to route internally for processing by the runtime
      eventTypeName - event type name
    • routeEventObjectArray

      public void routeEventObjectArray(Object[] event, String eventTypeName)
      Description copied from interface: EPEventServiceRouteEvent
      Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent. The route event is processed just like it was sent to the runtime, that is any active expressions seeking that event receive it. The routed event has priority over other events sent to the runtime. In a single-threaded application the routed event is processed before the next event is sent to the runtime.

      Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.

      Specified by:
      routeEventObjectArray in interface EPEventServiceRouteEvent
      Parameters:
      event - to route internally for processing by the runtime
      eventTypeName - event type name
    • routeEventXMLDOM

      public void routeEventXMLDOM(Node event, String eventTypeName)
      Description copied from interface: EPEventServiceRouteEvent
      Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent. The route event is processed just like it was sent to the runtime, that is any active expressions seeking that event receive it. The routed event has priority over other events sent to the runtime. In a single-threaded application the routed event is processed before the next event is sent to the runtime.

      Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.

      Specified by:
      routeEventXMLDOM in interface EPEventServiceRouteEvent
      Parameters:
      event - to route internally for processing by the runtime
      eventTypeName - event type name
    • routeEventAvro

      public void routeEventAvro(Object avroGenericDataDotRecord, String eventTypeName)
      Description copied from interface: EPEventServiceRouteEvent
      Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent. The route event is processed just like it was sent to the runtime, that is any active expressions seeking that event receive it. The routed event has priority over other events sent to the runtime. In a single-threaded application the routed event is processed before the next event is sent to the runtime.

      Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.

      Specified by:
      routeEventAvro in interface EPEventServiceRouteEvent
      Parameters:
      avroGenericDataDotRecord - to route internally for processing by the runtime
      eventTypeName - event type name
    • routeEventJson

      public void routeEventJson(String json, String eventTypeName)
      Description copied from interface: EPEventServiceRouteEvent
      Route the event object back to the runtime for internal dispatching, to avoid the possibility of a stack overflow due to nested calls to sendEvent. The route event is processed just like it was sent to the runtime, that is any active expressions seeking that event receive it. The routed event has priority over other events sent to the runtime. In a single-threaded application the routed event is processed before the next event is sent to the runtime.

      Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.

      Specified by:
      routeEventJson in interface EPEventServiceRouteEvent
      Parameters:
      json - to route internally for processing by the runtime
      eventTypeName - event type name
    • getURI

      public String getURI()
      Specified by:
      getURI in interface com.espertech.esper.common.internal.event.util.EPRuntimeEventProcessWrapped
    • getEventSender

      public com.espertech.esper.common.client.EventSender getEventSender(String eventTypeName) throws com.espertech.esper.common.client.EventTypeException
      Description copied from interface: EPEventService
      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.

      Specified by:
      getEventSender in interface EPEventService
      Parameters:
      eventTypeName - is the name of the event type
      Returns:
      sender for fast-access processing of event objects of known type (and content)
      Throws:
      com.espertech.esper.common.client.EventTypeException - thrown to indicate that the name does not exist
    • getStatementNearestSchedules

      public Map<com.espertech.esper.common.internal.util.DeploymentIdNamePair,Long> getStatementNearestSchedules()
      Specified by:
      getStatementNearestSchedules in interface EPEventServiceSPI
    • clockInternal

      public void clockInternal()
      Description copied from interface: EPEventServiceTimeControl
      Switches on the internal timer which tracks system time. There is no effect if the runtime is already on internal time.

      Your application may not want to use EPEventServiceTimeControl.advanceTime(long), EPEventServiceTimeControl.advanceTimeSpan(long) or EPEventServiceTimeControl.advanceTimeSpan(long, long) after calling this method, since time advances according to JVM time.

      Specified by:
      clockInternal in interface EPEventServiceTimeControl
    • clockExternal

      public void clockExternal()
      Description copied from interface: EPEventServiceTimeControl
      Switches off the internal timer which tracks system time. There is no effect if the runtime is already on external internal time.

      Your application may want to use EPEventServiceTimeControl.advanceTime(long), EPEventServiceTimeControl.advanceTimeSpan(long) or EPEventServiceTimeControl.advanceTimeSpan(long, long) after calling this method to set or advance time.

      Its generally preferable to turn off internal clocking (and thus turn on external clocking) by configuration ConfigurationRuntimeThreading.setInternalTimerEnabled(boolean) passing false.

      Specified by:
      clockExternal in interface EPEventServiceTimeControl
    • getNumEventsEvaluated

      public long getNumEventsEvaluated()
      Description copied from interface: EPEventService
      Number of events evaluated over the lifetime of the event stream processing runtime, or since the last resetStats() call.
      Specified by:
      getNumEventsEvaluated in interface EPEventService
      Returns:
      number of events received
    • resetStats

      public void resetStats()
      Description copied from interface: EPEventService
      Reset the count of the number of events received and emitted
      Specified by:
      resetStats in interface EPEventService