|
||||||||||
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 callbacks for a certain time which are called when the evaluate method is invoked and the current time is on or after the callback times. It is the expectation that the triggerPast method is called with same or ascending values for each subsequent call. Callbacks with are triggered are automatically removed by implementations.
Method Summary | |
---|---|
void |
add(long afterMSec,
ScheduleCallback callback,
ScheduleSlot slot)
Add a callback for after the given milliseconds from the current time. |
void |
add(ScheduleSpec scheduleSpec,
ScheduleCallback callback,
ScheduleSlot slot)
Add a callback for a time specified by the schedule specification passed in based on the current time. |
ScheduleBucket |
allocateBucket()
Returns a bucket from which slots can be allocated for ordering concurrent callbacks. |
void |
evaluate()
Evaluate the current time and perform any callbacks. |
long |
getTime()
Gets the last time known to the scheduling service. |
void |
remove(ScheduleCallback callback,
ScheduleSlot slot)
Remove a callback. |
void |
setTime(long timestamp)
Set the time based upon which the evaluation of events invokes callbacks. |
Method Detail |
---|
void add(long afterMSec, ScheduleCallback callback, ScheduleSlot slot) throws ScheduleServiceException
afterMSec
- number of millisec to get a callbackcallback
- to addslot
- allows ordering of concurrent callbacks
ScheduleServiceException
- thrown if the add operation did not completevoid add(ScheduleSpec scheduleSpec, ScheduleCallback callback, ScheduleSlot slot) throws ScheduleServiceException
scheduleSpec
- holds the crontab-like information defining the next occurancecallback
- to addslot
- allows ordering of concurrent callbacks
ScheduleServiceException
- thrown if the add operation did not completevoid remove(ScheduleCallback callback, ScheduleSlot slot) throws ScheduleServiceException
callback
- to removeslot
- for which the callback was added
ScheduleServiceException
- thrown if the callback was not locatedlong getTime()
void setTime(long timestamp)
timestamp
- to setvoid evaluate()
ScheduleBucket allocateBucket()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |