com.espertech.esperio
Class AdapterCoordinatorImpl

java.lang.Object
  extended by com.espertech.esperio.AbstractCoordinatedAdapter
      extended by com.espertech.esperio.AdapterCoordinatorImpl
All Implemented Interfaces:
com.espertech.esper.adapter.Adapter, com.espertech.esper.adapter.InputAdapter, AdapterCoordinator, CoordinatedAdapter

public class AdapterCoordinatorImpl
extends AbstractCoordinatedAdapter
implements AdapterCoordinator

An implementation of AdapterCoordinator.


Field Summary
 
Fields inherited from class com.espertech.esperio.AbstractCoordinatedAdapter
eventsToSend, scheduleSlot, stateManager
 
Fields inherited from interface com.espertech.esper.adapter.InputAdapter
ESPERIO_MAP_EVENT_TYPE
 
Constructor Summary
AdapterCoordinatorImpl(com.espertech.esper.client.EPServiceProvider epService, boolean usingEngineThread)
          Ctor.
AdapterCoordinatorImpl(com.espertech.esper.client.EPServiceProvider epService, boolean usingEngineThread, boolean usingExternalTimer, boolean usingTimeSpanEvents)
          Ctor.
 
Method Summary
protected  void close()
          Does nothing.
 void coordinate(com.espertech.esper.adapter.InputAdapter inputAdapter)
          Coordinate an InputAdapter.
 SendableEvent read()
          Get the next event in line to be sent into the runtime , or null if there is no available event.
protected  void replaceFirstEventToSend()
          Replace the first member of eventsToSend with the next event returned by the read() method of the same Adapter that provided the first event.
protected  void reset()
          Reset all the changeable state of this ReadableAdapter, as if it were just created.
 
Methods inherited from class com.espertech.esperio.AbstractCoordinatedAdapter
destroy, disallowStateTransitions, getRuntime, getState, pause, resume, setEPService, setScheduleSlot, setSender, setUsingEngineThread, setUsingExternalTimer, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.espertech.esper.adapter.Adapter
destroy, getState, pause, resume, start, stop
 

Constructor Detail

AdapterCoordinatorImpl

public AdapterCoordinatorImpl(com.espertech.esper.client.EPServiceProvider epService,
                              boolean usingEngineThread)
Ctor.

Parameters:
epService - - the EPServiceProvider for the engine services and runtime
usingEngineThread - - true if the coordinator should set time by the scheduling service in the engine, false if it should set time externally through the calling thread

AdapterCoordinatorImpl

public AdapterCoordinatorImpl(com.espertech.esper.client.EPServiceProvider epService,
                              boolean usingEngineThread,
                              boolean usingExternalTimer,
                              boolean usingTimeSpanEvents)
Ctor.

Parameters:
epService - - the EPServiceProvider for the engine services and runtime
usingEngineThread - - true if the coordinator should set time by the scheduling service in the engine, false if it should set time externally through the calling thread
usingExternalTimer - - true to use esper's external timer mechanism instead of internal timing
Method Detail

read

public SendableEvent read()
                   throws com.espertech.esper.client.EPException
Description copied from interface: CoordinatedAdapter
Get the next event in line to be sent into the runtime , or null if there is no available event.

Specified by:
read in interface CoordinatedAdapter
Returns:
an instance of SendableEvent that wraps the next event to send, or null if none
Throws:
com.espertech.esper.client.EPException - in case of errors creating the event

coordinate

public void coordinate(com.espertech.esper.adapter.InputAdapter inputAdapter)
Description copied from interface: AdapterCoordinator
Coordinate an InputAdapter.

Specified by:
coordinate in interface AdapterCoordinator
Parameters:
inputAdapter - - the InputAdapter to coordinate

close

protected void close()
Does nothing.

Specified by:
close in class AbstractCoordinatedAdapter

replaceFirstEventToSend

protected void replaceFirstEventToSend()
Replace the first member of eventsToSend with the next event returned by the read() method of the same Adapter that provided the first event.

Specified by:
replaceFirstEventToSend in class AbstractCoordinatedAdapter

reset

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

Specified by:
reset in class AbstractCoordinatedAdapter

© 2006-2016 EsperTech Inc.
All rights reserved.
Visit us at espertech.com