| |
|
| org.cougaar.lib.filter.UTILPluginAdapter org.cougaar.lib.filter.UTILBufferingPluginAdapter
All known Subclasses: org.cougaar.logistics.plugin.trans.base.SequentialPlannerPlugin, org.cougaar.lib.vishnu.client.VishnuPlugin, org.cougaar.lib.filter.UTILAggregatorPluginAdapter, org.cougaar.lib.filter.UTILExpanderPluginAdapter, org.cougaar.lib.filter.UTILAllocatorPluginAdapter,
UTILBufferingPluginAdapter | abstract public class UTILBufferingPluginAdapter extends UTILPluginAdapter implements UTILBufferingPlugin(Code) | |
Example implementation of a plugin that buffers tasks
until a certain threshold is reached. processTasks is then called.
allocators, expanders, and aggregators should all be derived from
this instead of PluginAdapter; we can then turn on buffering at a higher
level by changing the default for buffering from 1. (which is = to no
buffering at all)
Abstract because these are undefined:
createThreadCallback -- half of the determination of the flavor of a plugin
(Allocator, Expander, Aggregator). The other half is declaring them listeners
of the right type.
processTasks -- different for each plugin flavor
|
Inner Class :public class PluginAlarm implements Alarm | |
currentAlarm | protected PluginAlarm currentAlarm(Code) | | |
createThreadCallback | abstract protected UTILFilterCallback createThreadCallback(UTILGenericListener listener)(Code) | | Provide the callback that is paired with the buffering thread, which is a
listener. The buffering thread is the listener to the callback
a FilterCallback with the buffering thread as its listener |
examineBufferAgainIn | public void examineBufferAgainIn(long delayTime)(Code) | | Buffering runnable wants to restart later
|
execute | protected void execute()(Code) | | Called every time one of the filterCallback subscriptions
change.
What the plugin does in response to a changed subscription.
Directs the filterCallback with the changed subscription
to react to the change in some way.
|
interestingTask | public boolean interestingTask(Task t)(Code) | | Implemented for UTILBufferingPlugin
OVERRIDE to specialize tasks you find interesting.
Parameters: t - Task to check for interest boolean true if task is interesting |
isTaskWellFormed | public boolean isTaskWellFormed(Task t)(Code) | |
Examines task to see if task looks like what the plugin
expects it to look like.
This is plugin-dependent. For example, the
planning factor for unloading a ship is 2 days, but
if the task's time window is 1 day, the task is
not "well formed." Duration is a common test, but others
could also be a good idea...
This is an explicit contract with the plugin
that feeds this plugins tasks, governing which tasks
are possible for this plugin to handle.
Parameters: t - Task to check for consistency true if task is OK |
localSetup | public void localSetup()(Code) | |
Start up the task buffering thread.
Note that localSetup is called AFTER setupFilters, so
getBufferingThread will not return null;
IT IS CRUCIAL that this gets called with super () if this
is overridden! Otherwise, plugin will be effectively dead.
|
processTasks | abstract public void processTasks(List tasks)(Code) | | Implemented for UTILBufferingPlugin
Deal with the tasks that we have accumulated.
ABSTRACT, so derived plugins must implement this.
Parameters: tasks - List of tasks to handle |
reportIllFormedTask | protected void reportIllFormedTask(Task t)(Code) | | |
resume | public void resume()(Code) | | |
setupFilters | public void setupFilters()(Code) | | Note that setupFilters is called BEFORE localSetup, so
getBufferingThread will not return null;
|
wakeUp | public void wakeUp()(Code) | | |
|
|
|