|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esperio.AbstractCoordinatedAdapter
public abstract class AbstractCoordinatedAdapter
A skeleton implementation for coordinated adapter reading, for adapters that can do timestamp-coordinated input.
Field Summary | |
---|---|
protected SortedSet<SendableEvent> |
eventsToSend
Sorted events to be sent. |
protected com.espertech.esper.schedule.ScheduleSlot |
scheduleSlot
Slot for scheduling. |
protected AdapterStateManager |
stateManager
Statement management. |
Fields inherited from interface com.espertech.esperio.InputAdapter |
---|
ESPERIO_MAP_EVENT_TYPE |
Constructor Summary | |
---|---|
AbstractCoordinatedAdapter(com.espertech.esper.client.EPServiceProvider epService,
boolean usingEngineThread,
boolean usingExternalTimer)
Ctor. |
Method Summary | |
---|---|
protected abstract void |
close()
Perform any actions specific to this Adapter that should be completed before the Adapter is stopped. |
void |
destroy()
Destroy the Adapter, stopping the sending of all events and releasing all the resources, and disallowing any further state changes on the Adapter. |
void |
disallowStateTransitions()
Disallow subsequent state changes and throw an IllegalStateTransitionException if they are attempted. |
AdapterState |
getState()
Get the state of this Adapter. |
void |
pause()
Pause the sending of events after a Adapter has been started. |
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()
Resume sending events after the Adapter has been paused. |
void |
setEPService(com.espertech.esper.client.EPServiceProvider epService)
Set the epService |
void |
setScheduleSlot(com.espertech.esper.schedule.ScheduleSlot scheduleSlot)
Set the scheduleSlot for this Adapter. |
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()
Start the sending of events into the runtime egine. |
void |
stop()
Stop sending events and return the Adapter to the OPENED state, ready to be started once again. |
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.CoordinatedAdapter |
---|
read |
Field Detail |
---|
protected final AdapterStateManager stateManager
protected final SortedSet<SendableEvent> eventsToSend
protected com.espertech.esper.schedule.ScheduleSlot scheduleSlot
Constructor Detail |
---|
public AbstractCoordinatedAdapter(com.espertech.esper.client.EPServiceProvider epService, boolean usingEngineThread, boolean usingExternalTimer)
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 timingMethod Detail |
---|
public AdapterState getState()
Adapter
getState
in interface Adapter
public void start() throws com.espertech.esper.client.EPException
Adapter
start
in interface Adapter
com.espertech.esper.client.EPException
- in case of errors processing the eventspublic void pause() throws com.espertech.esper.client.EPException
Adapter
pause
in interface Adapter
com.espertech.esper.client.EPException
- if this Adapter has already been stoppedpublic void resume() throws com.espertech.esper.client.EPException
Adapter
resume
in interface Adapter
com.espertech.esper.client.EPException
- in case of errors processing the eventspublic void destroy() throws com.espertech.esper.client.EPException
Adapter
destroy
in interface Adapter
com.espertech.esper.client.EPException
- to indicate errors during destroypublic void stop() throws com.espertech.esper.client.EPException
Adapter
stop
in interface Adapter
com.espertech.esper.client.EPException
- in case of errors releasing resourcespublic 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(com.espertech.esper.schedule.ScheduleSlot 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()
|
© 2007 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |