public abstract class AbstractCoordinatedAdapter extends java.lang.Object implements CoordinatedAdapter
Modifier and Type | Field and Description |
---|---|
protected java.util.SortedSet<SendableEvent> |
eventsToSend
Sorted events to be sent.
|
protected long |
scheduleSlot
Slot for scheduling.
|
protected com.espertech.esper.adapter.AdapterStateManager |
stateManager
Statement management.
|
Constructor and Description |
---|
AbstractCoordinatedAdapter(com.espertech.esper.client.EPServiceProvider epService,
boolean usingEngineThread,
boolean usingExternalTimer,
boolean usingTimeSpanEvents)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
close()
Perform any actions specific to this Adapter that should
be completed before the Adapter is stopped.
|
void |
destroy() |
void |
disallowStateTransitions()
Disallow subsequent state changes and throw an IllegalStateTransitionException
if they are attempted.
|
com.espertech.esper.client.EPRuntime |
getRuntime()
Returns the runtime.
|
com.espertech.esper.adapter.AdapterState |
getState() |
void |
pause() |
protected abstract void |
replaceFirstEventToSend()
Remove the first member of eventsToSend and insert
another event chosen in some fashion specific to this
Adapter.
|
protected abstract void |
reset()
Reset all the changeable state of this Adapter, as if it were just created.
|
void |
resume() |
void |
setEPService(com.espertech.esper.client.EPServiceProvider epService)
Set the epService
|
void |
setScheduleSlot(long scheduleSlot)
Set the scheduleSlot for this Adapter.
|
void |
setSender(AbstractSender sender)
Sets a new sender to use.
|
void |
setUsingEngineThread(boolean usingEngineThread)
Set the usingEngineThread value
|
void |
setUsingExternalTimer(boolean usingExternalTimer)
Set to true to use esper's external timer mechanism instead of internal timing
|
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
read
protected final com.espertech.esper.adapter.AdapterStateManager stateManager
protected final java.util.SortedSet<SendableEvent> eventsToSend
protected long scheduleSlot
public AbstractCoordinatedAdapter(com.espertech.esper.client.EPServiceProvider epService, boolean usingEngineThread, boolean usingExternalTimer, boolean usingTimeSpanEvents)
epService
- - the EPServiceProvider for the engine runtime and servicesusingEngineThread
- - true if the Adapter should set time by the scheduling service in the engine,
false if it should set time externally through the calling threadusingExternalTimer
- - true to use esper's external timer mechanism instead of internal timingusingTimeSpanEvents
- - true for time span eventspublic com.espertech.esper.adapter.AdapterState getState()
getState
in interface com.espertech.esper.adapter.Adapter
public void start() throws com.espertech.esper.client.EPException
start
in interface com.espertech.esper.adapter.Adapter
com.espertech.esper.client.EPException
public void pause() throws com.espertech.esper.client.EPException
pause
in interface com.espertech.esper.adapter.Adapter
com.espertech.esper.client.EPException
public void resume() throws com.espertech.esper.client.EPException
resume
in interface com.espertech.esper.adapter.Adapter
com.espertech.esper.client.EPException
public void destroy() throws com.espertech.esper.client.EPException
destroy
in interface com.espertech.esper.adapter.Adapter
com.espertech.esper.client.EPException
public void stop() throws com.espertech.esper.client.EPException
stop
in interface com.espertech.esper.adapter.Adapter
com.espertech.esper.client.EPException
public void disallowStateTransitions()
CoordinatedAdapter
disallowStateTransitions
in interface CoordinatedAdapter
public void setUsingEngineThread(boolean usingEngineThread)
CoordinatedAdapter
setUsingEngineThread
in interface CoordinatedAdapter
usingEngineThread
- - the value to setpublic void setUsingExternalTimer(boolean usingExternalTimer)
setUsingExternalTimer
in interface CoordinatedAdapter
usingExternalTimer
- true for external timerpublic void setScheduleSlot(long scheduleSlot)
CoordinatedAdapter
setScheduleSlot
in interface CoordinatedAdapter
scheduleSlot
- - the scheduleSlot to setpublic void setEPService(com.espertech.esper.client.EPServiceProvider epService)
CoordinatedAdapter
setEPService
in interface CoordinatedAdapter
epService
- - the value to setprotected abstract void close()
protected abstract void replaceFirstEventToSend()
protected abstract void reset()
public com.espertech.esper.client.EPRuntime getRuntime()
public void setSender(AbstractSender sender)
sender
- for sending