|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--arlut.csd.ganymede.scheduleHandle
Handle object used to help manage background tasks registered in the
Ganymede Server's
GanymedeScheduler. In addition
to being used by the server's task scheduler to organize and track
registered tasks, vectors of serialized scheduleHandle objects are passed to the
Ganymede admin console's
changeTasks
method.
Within the Ganymede server, scheduleHandle objects are held within the
GanymedeScheduler to track the status of each registered task. When the
GanymedeScheduler needs to run a background task, the scheduleHandle's
runTask() method
is called. runTask() creates a pair of threads, one to run the task
and another taskMonitor thread
to wait for the task to be completed. When the thread running
the task completes, the task's taskMonitor calls the scheduleHandle's
notifyCompletion()
method, which in turn notifies the GanymedeScheduler that the task
has completed its execution.
The various scheduling methods in scheduleHandle will throw an IllegalArgumentException if called post-serialization on the Ganymede client.
| Field Summary | |
(package private) static boolean |
debug
|
(package private) java.util.Date |
incepDate
when was this task first registered? used to present a consistently sorted list on the client |
(package private) int |
interval
0 if this is a one-shot, otherwise, the count in minutes |
(package private) java.lang.String |
intervalString
For reporting our interval status to the admin console |
(package private) boolean |
isRunning
|
(package private) java.util.Date |
lastTime
When was this task last issued? |
(package private) java.lang.Thread |
monitor
If this task is currently running, this field will point to a monitor thread that is waiting for the task's thread to complete before reporting completion. |
(package private) java.lang.String |
name
For reporting our name to the admin console |
(package private) java.lang.Object[] |
options
Any options that we need to pass to the task? |
(package private) boolean |
rerun
if we are doing a on-demand and we get a request while running it, we'll want to immediately re-run it on completion |
(package private) GanymedeScheduler |
scheduler
The GanymedeScheduler that this task is registered in. |
(package private) java.util.Date |
startTime
When will this task next be issued? |
(package private) boolean |
suspend
|
(package private) java.lang.Runnable |
task
The task to run |
(package private) java.lang.Thread |
thread
If this task is currently running, this field will point to the running thread, otherwise it will be null. |
| Constructor Summary | |
scheduleHandle(GanymedeScheduler scheduler,
java.util.Date time,
int interval,
java.lang.Runnable task,
java.lang.String name)
|
|
| Method Summary | |
(package private) void |
disable()
Server-side method to disable future invocations of this task |
(package private) void |
enable()
Server-side method to enable future invocations of this task |
(package private) boolean |
isOnDemand()
Returns true if this task is not scheduled for periodic execution |
(package private) void |
notifyCompletion()
This method is called by our taskMonitor when our task
completes. |
(package private) boolean |
reschedule()
Server-side method to determine whether this task should be rescheduled. |
(package private) boolean |
runAgain()
This method lets the GanymedeScheduler check to see whether this task should be re-run when it terminates |
(package private) void |
runOnCompletion()
Server-side method to request that this task be re-run after its current completion. |
(package private) void |
runOnCompletion(java.lang.Object[] _options)
Server-side method to request that this task be re-run after its current completion. |
(package private) void |
runTask()
Runs this task in a background thread. |
(package private) void |
setInterval(int interval)
Server-side method to change the interval for this task |
(package private) void |
setOptions(java.lang.Object[] _options)
This method is used to set an options array for the next run of the task associated with this handle, if that task is a GanymedeBuilderTask. |
(package private) void |
stop()
Server-side method to bring this task to an abrupt halt. |
(package private) void |
unregister()
Server-side method to request that this task not be kept after its current completion. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static final boolean debug
boolean isRunning
boolean suspend
boolean rerun
java.util.Date lastTime
java.util.Date startTime
java.util.Date incepDate
java.lang.String intervalString
java.lang.String name
transient java.lang.Object[] options
transient int interval
transient java.lang.Runnable task
transient java.lang.Thread thread
transient java.lang.Thread monitor
transient GanymedeScheduler scheduler
| Constructor Detail |
public scheduleHandle(GanymedeScheduler scheduler,
java.util.Date time,
int interval,
java.lang.Runnable task,
java.lang.String name)
scheduler - Reference to the server's GanymedeSchedulertime - Anchor point for interval calculationsinterval - Number of seconds between runs of this tasktask - Java Runnable object to be run in a threadname - Name to report for this task| Method Detail |
void setOptions(java.lang.Object[] _options)
This method is used to set an options array for the next run of the task associated with this handle, if that task is a GanymedeBuilderTask.
If the task associated with this handle is not a GanymedeBuilderTask, the options will be ignored. Since setOptions() is synchronized, options may only be set at a time when runTask() is not busy issuing the task in the background. runTask() clears the options set, so setOptions() only affects the next launching of the task.
void runTask()
Runs this task in a background thread. A second background thread
is created to handle a taskMonitor
to wait and report when the task completes.
This method is invalid on the client.
void notifyCompletion()
This method is called by our taskMonitor when our task
completes. This method has no meaning outside of the context of
the taskMonitor spawned by this handle, and should not be called
from any other code.
boolean reschedule()
Server-side method to determine whether this task should be rescheduled. Increments the startTime and returns true if this is a periodically executed task.
boolean runAgain()
This method lets the GanymedeScheduler check to see whether this task should be re-run when it terminates
boolean isOnDemand()
Returns true if this task is not scheduled for periodic execution
void runOnCompletion()
Server-side method to request that this task be re-run after
its current completion. Intended for on-demand tasks that are
requested by the GanymedeScheduler while they are already running.
void runOnCompletion(java.lang.Object[] _options)
Server-side method to request that this task be re-run after
its current completion. Intended for on-demand tasks that are
requested by the GanymedeScheduler while they are already running.
void unregister()
Server-side method to request that this task not be kept after its current completion. Used to remove a task from the Ganymede scheduler.
void stop()
Server-side method to bring this task to an abrupt halt.
void disable()
Server-side method to disable future invocations of this task
void enable()
Server-side method to enable future invocations of this task
void setInterval(int interval)
Server-side method to change the interval for this task
interval - Number of seconds between runs of this task
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||