| java.lang.Object org.cougaar.planning.servlet.ServletWorker org.cougaar.glm.servlet.CompletionWatcherWorker
CompletionWatcherWorker | public class CompletionWatcherWorker extends ServletWorker (Code) | |
One created for every URL access.
Uses a blackboard
service, a watcher, and a trigger to monitor published tasks to see
when they are complete.
Note : may not return if it can't go through all it's states.
|
firstIntervalsecondInterval | protected long firstIntervalsecondInterval(Code) | | |
getImage | protected boolean getImage(Code) | | |
incompleteTasks | protected Set incompleteTasks(Code) | | |
startend | protected long startend(Code) | | |
state | protected int state(Code) | | |
advanceState | protected void advanceState(boolean allComplete, boolean hadNewTasks, boolean expired)(Code) | | Calls changeState -- then tests if isDone and if so signals doneSignal in getResult ().
See Also: CompletionWatcherWorker.getResult |
blackboardChanged | protected void blackboardChanged()(Code) | |
Called when either
1) the task subscription changes
2) the plan element subscription changes
3) a timer expires
Does book-keeping to keep track of incomplete tasks.
(If a plan element has completed, it's task is removed from the
set of incomplete tasks.)
Given whether all tasks are complete, if any arrived in the last transaction,
or if a timer expired, calls advance state.
|
cancelTimer | protected void cancelTimer()(Code) | | Cancel the timer.
|
changeState | protected void changeState(boolean waitedLongEnough, boolean allComplete, boolean hadNewTasks)(Code) | |
States are :
BEFORE_FIRST - some tasks are incomplete
Transition : when all are complete, start first timer, go to next state
DURING_FIRST - all tasks are complete
Transition : waited first interval, go to next state
Transition : saw incomplete task before time elapsed, go to previous state
END_OF_FIRST - the required quiet interval has elapsed
Transition : saw first incomplete task, mark time, go to next state
AFTER_FIRST - there are some incomplete tasks
Transition : all tasks complete, mark time, start second timer, go to next state
DURING_SECOND - all tasks are complete again, we're possibly done
Transition : waited second interval, go to next state
Transition : saw incomplete task before time elapsed, forget end time, go to previous state
AFTER_SECOND - we waited long enough to make sure we're done
Parameters: waitedLongEnough - -- if the timer expired, signaling the required wait was completed Parameters: allComplete - - are all tasks complete Parameters: hadNewTasks - - even if all tasks were complete, did any new tasks appear? |
getElapsedTime | protected String getElapsedTime(long diff)(Code) | | encodes a time interval in a min:sec:millis format
|
getSettings | public void getSettings(String name, String value)(Code) | |
Use a query parameter to set a field
Sets the recognized parameters : firstInterval, secondInterval
|
isDone | protected boolean isDone()(Code) | | we're done if the state machine is in the final state
|
isVerbIncluded | protected boolean isVerbIncluded(Verb verb)(Code) | | |
startFirstWait | protected void startFirstWait()(Code) | | |
startSecondWait | protected void startSecondWait()(Code) | | |
timerExpired | protected boolean timerExpired()(Code) | | Test if the timer has expired.
false if the timer is not running or has not yet expiredelse return true. |
|
|