|
||||||||||
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)
Add a callback for after the given milliseconds from the current time. |
void |
add(ScheduleSpec scheduleSpec,
ScheduleCallback callback)
Add a callback for a time specified by the schedule specification passed in based on the current time. |
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)
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) throws ScheduleServiceException
afterMSec
- number of millisec to get a callbackcallback
- to add
ScheduleServiceException
- thrown if the add operation did not completevoid add(ScheduleSpec scheduleSpec, ScheduleCallback callback) throws ScheduleServiceException
scheduleSpec
- holds the crontab-like information defining the next occurancecallback
- to add
ScheduleServiceException
- thrown if the add operation did not completevoid remove(ScheduleCallback callback) throws ScheduleServiceException
callback
- to remove
ScheduleServiceException
- thrown if the callback was not locatedlong getTime()
void setTime(long timestamp)
timestamp
- to setvoid evaluate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |