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.runtime.client.util.AdapterStateManager |
stateManager
Statement management.
|
Constructor and Description |
---|
AbstractCoordinatedAdapter(com.espertech.esper.runtime.client.EPRuntime runtime,
boolean usingRuntimeThread,
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.runtime.client.EPEventService |
getProcessEvent()
Returns the processEvent.
|
com.espertech.esper.runtime.client.util.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 |
setRuntime(com.espertech.esper.runtime.client.EPRuntime runtime)
Set the runtime
|
void |
setScheduleSlot(long scheduleSlot)
Set the scheduleSlot for this Adapter.
|
void |
setSender(AbstractSender sender)
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 |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
read
protected final com.espertech.esper.runtime.client.util.AdapterStateManager stateManager
protected final java.util.SortedSet<SendableEvent> eventsToSend
protected long scheduleSlot
public AbstractCoordinatedAdapter(com.espertech.esper.runtime.client.EPRuntime runtime, boolean usingRuntimeThread, boolean usingExternalTimer, boolean usingTimeSpanEvents)
runtime
- - the runtime for the runtimeprocessEvent and servicesusingRuntimeThread
- - true if the Adapter should set time by the scheduling service in the runtime,
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.runtime.client.util.AdapterState getState()
getState
in interface com.espertech.esper.runtime.client.util.Adapter
public void start() throws com.espertech.esper.common.client.EPException
start
in interface com.espertech.esper.runtime.client.util.Adapter
com.espertech.esper.common.client.EPException
public void pause() throws com.espertech.esper.common.client.EPException
pause
in interface com.espertech.esper.runtime.client.util.Adapter
com.espertech.esper.common.client.EPException
public void resume() throws com.espertech.esper.common.client.EPException
resume
in interface com.espertech.esper.runtime.client.util.Adapter
com.espertech.esper.common.client.EPException
public void destroy() throws com.espertech.esper.common.client.EPException
destroy
in interface com.espertech.esper.runtime.client.util.Adapter
com.espertech.esper.common.client.EPException
public void stop() throws com.espertech.esper.common.client.EPException
stop
in interface com.espertech.esper.runtime.client.util.Adapter
com.espertech.esper.common.client.EPException
public void disallowStateTransitions()
CoordinatedAdapter
disallowStateTransitions
in interface CoordinatedAdapter
public void setUsingRuntimeThread(boolean usingRuntimeThread)
CoordinatedAdapter
setUsingRuntimeThread
in interface CoordinatedAdapter
usingRuntimeThread
- - 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 setRuntime(com.espertech.esper.runtime.client.EPRuntime runtime)
CoordinatedAdapter
setRuntime
in interface CoordinatedAdapter
runtime
- - the value to setprotected abstract void close()
protected abstract void replaceFirstEventToSend()
protected abstract void reset()
public com.espertech.esper.runtime.client.EPEventService getProcessEvent()
public void setSender(AbstractSender sender)
sender
- for sending