|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.esper.schedule.SchedulingServiceImpl
public final class SchedulingServiceImpl
Implements the schedule service by simply keeping a sorted set of long millisecond values and a set of callbacks for each.
Constructor Summary | |
---|---|
SchedulingServiceImpl()
Constructor. |
Method Summary | |
---|---|
void |
add(long afterMSec,
ScheduleCallback callback)
Add a callback for after the given milliseconds from the current time. |
void |
add(ScheduleSpec spec,
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 currentTime)
Set the time based upon which the evaluation of events invokes callbacks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SchedulingServiceImpl()
Method Detail |
---|
public long getTime()
SchedulingService
getTime
in interface SchedulingService
public final void setTime(long currentTime)
SchedulingService
setTime
in interface SchedulingService
currentTime
- to setpublic final void add(long afterMSec, ScheduleCallback callback) throws ScheduleServiceException
SchedulingService
add
in interface SchedulingService
afterMSec
- number of millisec to get a callbackcallback
- to add
ScheduleServiceException
- thrown if the add operation did not completepublic final void add(ScheduleSpec spec, ScheduleCallback callback)
SchedulingService
add
in interface SchedulingService
spec
- holds the crontab-like information defining the next occurancecallback
- to addpublic final void remove(ScheduleCallback callback)
SchedulingService
remove
in interface SchedulingService
callback
- to removepublic final void evaluate()
SchedulingService
evaluate
in interface SchedulingService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |