|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SchedulerService
A service for scheduling Algorithm
s to be run.
SchedulerListener
s may be registered to be notified of events.
Application Developers are encouraged to use this service for scheduling
Algorithms to be run. Algorithm developers are encouraged not to use this
service as it is not guaranteed to be available like the standard CIShell
services are.
Method Summary | |
---|---|
void |
addSchedulerListener(SchedulerListener listener)
Adds a listener to be notified of events happening in the scheduler |
void |
clearSchedule()
Clears all currently scheduled Algorithms to be run. |
Algorithm[] |
getScheduledAlgorithms()
Returns an array of Algorithm s that the scheduler has scheduled. |
Calendar |
getScheduledTime(Algorithm algorithm)
Returns the time in which a scheduled Algorithm is scheduled to be run. |
ServiceReference |
getServiceReference(Algorithm algorithm)
Returns an Algorithm's associated ServiceReference if one was provided when the Algorithm was scheduled |
boolean |
isEmpty()
Returns if there are any Algorithms scheduled |
boolean |
isRunning()
Returns whether the scheduler is running |
void |
removeSchedulerListener(SchedulerListener listener)
Removes a SchedulerListener from the group of listeners listening
for scheduler events. |
boolean |
reschedule(Algorithm algorithm,
Calendar newTime)
Reschedules an already scheduled Algorithm to be run at a different time. |
void |
runNow(Algorithm algorithm,
ServiceReference ref)
Schedules an Algorithm to be run immediately. |
void |
schedule(Algorithm algorithm,
ServiceReference ref)
Schedules an Algorithm to be run when convenient. |
void |
schedule(Algorithm algorithm,
ServiceReference ref,
Calendar time)
Schedules an Algorithm to be run at a specific time. |
void |
setRunning(boolean isRunning)
Pauses or unpauses the running of new Algorithm s in the
scheduler |
boolean |
unschedule(Algorithm algorithm)
Unschedules an already scheduled, but not running Algorithm from the scheduler. |
Method Detail |
---|
void runNow(Algorithm algorithm, ServiceReference ref)
algorithm
- The algorithm to be runref
- A reference to the Algorithm's associated service, may
be null
void schedule(Algorithm algorithm, ServiceReference ref)
algorithm
- The Algorithm to be scheduledref
- A reference to the Algorithm's associated service, may
be null
void schedule(Algorithm algorithm, ServiceReference ref, Calendar time)
algorithm
- The Algorithm to be scheduledref
- A reference to the Algorithm's associated service, may
be null
time
- What time this Algorithm should be runboolean reschedule(Algorithm algorithm, Calendar newTime)
false
.
algorithm
- The Algorithm already schedulednewTime
- The revised time in which to run the Algorithm
boolean unschedule(Algorithm algorithm)
false
.
algorithm
- The Algorithm to remove from the scheduler
void addSchedulerListener(SchedulerListener listener)
listener
- The listener to be addedvoid removeSchedulerListener(SchedulerListener listener)
SchedulerListener
from the group of listeners listening
for scheduler events. This method has no effect if the listener isn't
in the group of listeners.
listener
- The listener to be removedboolean isRunning()
void setRunning(boolean isRunning)
Algorithm
s in the
scheduler
isRunning
- true
to pause,
false
to unpauseAlgorithm[] getScheduledAlgorithms()
Algorithm
s that the scheduler has scheduled.
This includes the Algorithms that are currently running and the ones
queued to be run. This also just gives a snapshot of the current set of
scheduled Algorithms, so it is not guaranteed to be accurate even
directly after the method returns.
Calendar getScheduledTime(Algorithm algorithm)
null
if the Algorithm is not scheduled.
algorithm
- The Algorithm
null
if the Algorithm is not scheduled or has completed executionServiceReference getServiceReference(Algorithm algorithm)
algorithm
- The Algorithm
void clearSchedule()
boolean isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |