Package com.espertech.esperio.csv
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
A skeleton implementation for coordinated adapter reading, for adapters that
can do timestamp-coordinated input.
-
Field Summary
Modifier and TypeFieldDescriptionprotected 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
ConstructorDescriptionAbstractCoordinatedAdapter
(com.espertech.esper.runtime.client.EPRuntime runtime, boolean usingRuntimeThread, boolean usingExternalTimer, boolean usingTimeSpanEvents) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
close()
Perform any actions specific to this Adapter that should be completed before the Adapter is stopped.void
destroy()
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
getState()
void
pause()
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()
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 runtimevoid
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 timingvoid
setUsingRuntimeThread
(boolean usingRuntimeThread) Set the usingRuntimeThread valuevoid
start()
void
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.esperio.csv.CoordinatedAdapter
read
-
Field Details
-
stateManager
protected final com.espertech.esper.runtime.client.util.AdapterStateManager stateManagerStatement management. -
eventsToSend
Sorted events to be sent. -
scheduleSlot
protected long scheduleSlotSlot 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 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 events
-
-
Method Details
-
getState
public com.espertech.esper.runtime.client.util.AdapterState getState()- Specified by:
getState
in interfacecom.espertech.esper.runtime.client.util.Adapter
-
start
public void start() throws com.espertech.esper.common.client.EPException- Specified by:
start
in interfacecom.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 interfacecom.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 interfacecom.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 interfacecom.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 interfacecom.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 interfaceCoordinatedAdapter
-
setUsingRuntimeThread
public void setUsingRuntimeThread(boolean usingRuntimeThread) Description copied from interface:CoordinatedAdapter
Set the usingRuntimeThread value- Specified by:
setUsingRuntimeThread
in interfaceCoordinatedAdapter
- 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 interfaceCoordinatedAdapter
- 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 interfaceCoordinatedAdapter
- 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 interfaceCoordinatedAdapter
- 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
Sets a new sender to use.- Parameters:
sender
- for sending
-