Class AbstractCoordinatedAdapter

java.lang.Object
com.espertech.esperio.csv.AbstractCoordinatedAdapter
All Implemented Interfaces:
com.espertech.esper.runtime.client.util.Adapter, com.espertech.esper.runtime.client.util.InputAdapter, CoordinatedAdapter
Direct Known Subclasses:
AdapterCoordinatorImpl, CSVInputAdapter

public abstract class AbstractCoordinatedAdapter extends Object implements CoordinatedAdapter
A skeleton implementation for coordinated adapter reading, for adapters that can do timestamp-coordinated input.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final SortedSet<SendableEvent>
    Sorted events to be sent.
    protected long
    Slot for scheduling.
    protected final com.espertech.esper.runtime.client.util.AdapterStateManager
    Statement management.

    Fields inherited from interface com.espertech.esper.runtime.client.util.InputAdapter

    ESPERIO_JSON_EVENT_TYPE, ESPERIO_MAP_EVENT_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractCoordinatedAdapter(com.espertech.esper.runtime.client.EPRuntime runtime, boolean usingRuntimeThread, boolean usingExternalTimer, boolean usingTimeSpanEvents)
    Ctor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Perform any actions specific to this Adapter that should be completed before the Adapter is stopped.
    void
     
    void
    Disallow subsequent state changes and throw an IllegalStateTransitionException if they are attempted.
    com.espertech.esper.runtime.client.EPEventService
    Returns the processEvent.
    com.espertech.esper.runtime.client.util.AdapterState
     
    void
     
    protected abstract void
    Remove the first member of eventsToSend and insert another event chosen in some fashion specific to this Adapter.
    protected abstract void
    Reset all the changeable state of this Adapter, as if it were just created.
    void
     
    void
    setRuntime(com.espertech.esper.runtime.client.EPRuntime runtime)
    Set the runtime
    void
    setScheduleSlot(long scheduleSlot)
    Set the scheduleSlot for this Adapter.
    void
    Sets a new sender to use.
    void
    setUsingExternalTimer(boolean usingExternalTimer)
    Set to true to use esper's external timer mechanism instead of internal timing
    void
    setUsingRuntimeThread(boolean usingRuntimeThread)
    Set the usingRuntimeThread value
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.espertech.esperio.csv.CoordinatedAdapter

    read
  • Field Details

    • stateManager

      protected final com.espertech.esper.runtime.client.util.AdapterStateManager stateManager
      Statement management.
    • eventsToSend

      protected final SortedSet<SendableEvent> eventsToSend
      Sorted events to be sent.
    • scheduleSlot

      protected long scheduleSlot
      Slot for scheduling.
  • Constructor Details

    • AbstractCoordinatedAdapter

      public AbstractCoordinatedAdapter(com.espertech.esper.runtime.client.EPRuntime runtime, boolean usingRuntimeThread, boolean usingExternalTimer, boolean usingTimeSpanEvents)
      Ctor.
      Parameters:
      runtime - - the runtime for the runtimeprocessEvent and services
      usingRuntimeThread - - true if the Adapter should set time by the scheduling service in the runtime, false if it should set time externally through the calling thread
      usingExternalTimer - - true to use esper's external timer mechanism instead of internal timing
      usingTimeSpanEvents - - true for time span events
  • Method Details

    • getState

      public com.espertech.esper.runtime.client.util.AdapterState getState()
      Specified by:
      getState in interface com.espertech.esper.runtime.client.util.Adapter
    • start

      public void start() throws com.espertech.esper.common.client.EPException
      Specified by:
      start in interface com.espertech.esper.runtime.client.util.Adapter
      Throws:
      com.espertech.esper.common.client.EPException
    • pause

      public void pause() throws com.espertech.esper.common.client.EPException
      Specified by:
      pause in interface com.espertech.esper.runtime.client.util.Adapter
      Throws:
      com.espertech.esper.common.client.EPException
    • resume

      public void resume() throws com.espertech.esper.common.client.EPException
      Specified by:
      resume in interface com.espertech.esper.runtime.client.util.Adapter
      Throws:
      com.espertech.esper.common.client.EPException
    • destroy

      public void destroy() throws com.espertech.esper.common.client.EPException
      Specified by:
      destroy in interface com.espertech.esper.runtime.client.util.Adapter
      Throws:
      com.espertech.esper.common.client.EPException
    • stop

      public void stop() throws com.espertech.esper.common.client.EPException
      Specified by:
      stop in interface com.espertech.esper.runtime.client.util.Adapter
      Throws:
      com.espertech.esper.common.client.EPException
    • disallowStateTransitions

      public void disallowStateTransitions()
      Description copied from interface: CoordinatedAdapter
      Disallow subsequent state changes and throw an IllegalStateTransitionException if they are attempted.
      Specified by:
      disallowStateTransitions in interface CoordinatedAdapter
    • setUsingRuntimeThread

      public void setUsingRuntimeThread(boolean usingRuntimeThread)
      Description copied from interface: CoordinatedAdapter
      Set the usingRuntimeThread value
      Specified by:
      setUsingRuntimeThread in interface CoordinatedAdapter
      Parameters:
      usingRuntimeThread - - the value to set
    • setUsingExternalTimer

      public void setUsingExternalTimer(boolean usingExternalTimer)
      Set to true to use esper's external timer mechanism instead of internal timing
      Specified by:
      setUsingExternalTimer in interface CoordinatedAdapter
      Parameters:
      usingExternalTimer - true for external timer
    • setScheduleSlot

      public void setScheduleSlot(long scheduleSlot)
      Description copied from interface: CoordinatedAdapter
      Set the scheduleSlot for this Adapter.
      Specified by:
      setScheduleSlot in interface CoordinatedAdapter
      Parameters:
      scheduleSlot - - the scheduleSlot to set
    • setRuntime

      public void setRuntime(com.espertech.esper.runtime.client.EPRuntime runtime)
      Description copied from interface: CoordinatedAdapter
      Set the runtime
      Specified by:
      setRuntime in interface CoordinatedAdapter
      Parameters:
      runtime - - the value to set
    • close

      protected abstract void close()
      Perform any actions specific to this Adapter that should be completed before the Adapter is stopped.
    • replaceFirstEventToSend

      protected abstract void replaceFirstEventToSend()
      Remove the first member of eventsToSend and insert another event chosen in some fashion specific to this Adapter.
    • reset

      protected abstract void reset()
      Reset all the changeable state of this Adapter, as if it were just created.
    • getProcessEvent

      public com.espertech.esper.runtime.client.EPEventService getProcessEvent()
      Returns the processEvent.
      Returns:
      processEvent
    • setSender

      public void setSender(AbstractSender sender)
      Sets a new sender to use.
      Parameters:
      sender - for sending