|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SchedulingService
Interface for a service that allows to add and remove handles (typically storing callbacks) for a certain time which are returned when the evaluate method is invoked and the current time is on or after the handle's registered time. It is the expectation that the setTime method is called with same or ascending values for each subsequent call. Handles with are triggered are automatically removed by implementations.
Method Summary | |
---|---|
void |
add(long afterMSec,
ScheduleHandle handle,
ScheduleSlot slot)
Add a callback for after the given milliseconds from the current time. |
void |
destroy()
Destroy the service. |
void |
evaluate(java.util.Collection<ScheduleHandle> handles)
Evaluate the current time and add to the collection any handles scheduled for execution. |
java.lang.Long |
getFurthestTimeHandle()
Returns furthest in the future handle. |
int |
getScheduleHandleCount()
Returns count of handles. |
int |
getTimeHandleCount()
Returns time handle count. |
boolean |
isScheduled(ScheduleHandle handle)
Returns true if the handle has been scheduled already. |
void |
remove(ScheduleHandle handle,
ScheduleSlot slot)
Remove a handle. |
void |
setTime(long timestamp)
Set the time based upon which the evaluation of events invokes callbacks. |
Methods inherited from interface com.espertech.esper.schedule.TimeProvider |
---|
getTime |
Method Detail |
---|
void add(long afterMSec, ScheduleHandle handle, ScheduleSlot slot) throws ScheduleServiceException
afterMSec
- number of millisec to get a callbackhandle
- to addslot
- allows ordering of concurrent callbacks
ScheduleServiceException
- thrown if the add operation did not completevoid remove(ScheduleHandle handle, ScheduleSlot slot) throws ScheduleServiceException
handle
- to removeslot
- for which the callback was added
ScheduleServiceException
- thrown if the callback was not locatedvoid setTime(long timestamp)
timestamp
- to setvoid evaluate(java.util.Collection<ScheduleHandle> handles)
handles
- is a collection of handles populated by the service with any callbacks due
for the current timevoid destroy()
int getTimeHandleCount()
java.lang.Long getFurthestTimeHandle()
int getScheduleHandleCount()
boolean isScheduled(ScheduleHandle handle)
handle
- to check
|
© 2006-2015 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 |