| java.lang.Object org.cougaar.logistics.plugin.utils.TaskScheduler
TaskScheduler | public class TaskScheduler (Code) | | A TaskScheduler instance takes as arguments a predicate
and a TaskSchedulingPolicy instance.
It sets up n incremental subscriptions, one corresponding to
each priority level in the TaskSchedulingPolicy.
The predicate for the ith incremental subscription
is a logical and of the predicate given as an argument and a
test whether the task has priority i.
The TaskScheduler keeps track of tasks across execute cycles
so that tasks are not cleared away as they normally are from
a subscription (assuming the plugin properly calls initForExecuteCycle
each time through).
The TaskScheduler handles the bookkeeping associated with
stepping through the various phases of processing, based on
both priorities and time intervals, specified in the policy.
The plugin must call initForExecuteCycle before processing the
tasks during each execute cycle and finishedExecuteCycle after
processing the tasks.
|
clearState | public void clearState()(Code) | | Clear out all the state information from the task scheduler
|
finishedExecuteCycle | public void finishedExecuteCycle()(Code) | | |
finishedExecuteCycle | public void finishedExecuteCycle(boolean didProcessing)(Code) | | Plugins call this at end of execute cycle
Parameters: didProcessing - true if the plugin processed the tasks and it's now safe to remove themfrom the task scheduler's task queue. |
getAddedCollection | public Collection getAddedCollection()(Code) | | All added tasks at given priority since last cleared
|
getChangedCollection | public Collection getChangedCollection()(Code) | | All changed tasks at given priority since last cleared
|
getCurrentPriority | public int getCurrentPriority()(Code) | | Tell the priority associated with the current processing phase
|
getCurrentTimeSpan | public TimeSpan getCurrentTimeSpan()(Code) | | Tell the time interval associate with the current phase
|
getRemovedCollection | public Collection getRemovedCollection()(Code) | | All removed tasks at given priority since last cleared
|
initForExecuteCycle | public void initForExecuteCycle()(Code) | | Plugins must call this each execute cycle before accessing any tasks,
whether or not they access any tasks that cycle
|
isEmpty | public boolean isEmpty()(Code) | | check if anything to do in this scheduler
|
|
|