Java Doc for VishnuPlugin.java in  » Science » Cougaar12_4 » org » cougaar » lib » vishnu » client » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.lib.vishnu.client 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.cougaar.lib.filter.UTILBufferingPluginAdapter
   org.cougaar.lib.vishnu.client.VishnuPlugin

All known Subclasses:   org.cougaar.lib.vishnu.client.VishnuAllocatorPlugin,  org.cougaar.lib.vishnu.client.VishnuAggregatorPlugin,  org.cougaar.lib.vishnu.client.VishnuExpanderPlugin,
VishnuPlugin
abstract public class VishnuPlugin extends UTILBufferingPluginAdapter implements UTILAssetListener,DirectModeListener,ResultListener(Code)
 ALP-Vishnu bridge.
 Base class for interacting with the Vishnu scheduler.
 There are 3 main dimensions of behavior for this plugin: 
 - SchedulerMode (External, Internal, or Direct)         
 - Job type      (Batch or Incremental)                  
 - Translation   (Automatic or Custom)                   
 Supports three main scheduler modes : External, Internal, and Direct.  These
 are classes which implement the SchedulerLifecycle interface.  They
 orchestrate the steps to use the Vishnu Scheduler.  The VishnuPlugin
 is a ModeListener and its as a mode listener that the modes communicate
 with the plugin.
 External mode uses the web server and expects the scheduling to be 
 done by a separate Vishnu Scheduler process.  All communication is done with 
 XML.
 Internal mode uses an internal Vishnu Scheduler process, but 
 communicates exclusively through XML.
 Direct mode extends internal mode, but directly translates between
 Cougaar objects and Vishnu scheduling objects.
 The results of a scheduling job are handled by a ResultHandler, which
 can be either an XMLResultHandler, or a DirectResultHandler. Each mode is a
 ResultListener and communicates with its result handler.
 Orthogonal to the scheduling modes, the scheduling jobs can be either 
 batch or incremental.  Batch starts from scratch every time, but 
 incremental mode maintains scheduler state from previous batches.
 Further, XML translation can either be automatic or custom.  Automatic
 mode uses introspection to determine the object format of the problem,
 whereas custom forces the developer to define it and participate in 
 the translation process.
 Abstract because it does not define :
 - createThreadCallback
 each of which is defined in the allocator, aggregator, and expander 
 subclasses.
 

See Also:   org.cougaar.lib.filter.UTILBufferingPluginAdapter.createThreadCallback
See Also:   org.cougaar.lib.vishnu.client.VishnuAggregatorPlugin.createThreadCallback
See Also:   org.cougaar.lib.vishnu.client.VishnuAllocatorPlugin.createThreadCallback
See Also:   org.cougaar.lib.vishnu.client.VishnuExpanderPlugin.createThreadCallback
See Also:   


Field Summary
protected  VishnuCommcomm
    
protected  VishnuConfigconfig
    
protected  VishnuDomUtildomUtil
    
protected  intfirstTemplateTasks
    
protected  booleanincrementalScheduling
    
protected  booleanlocalDidRehydrate
    
protected  booleanmakeSetupAndWrapupTasks
    
protected  SchedulerLifecyclemode
    
protected  UTILAssetCallbackmyAssetCallback
    
protected  MapmyAssetUIDtoObject
    
protected  SetmyChangedAssets
    
protected  SetmyNewAssets
    
protected  MapmyTaskUIDtoObject
    
protected  DocumentobjectFormatDoc
    
protected  ResultHandlerresultHandler
    
protected  booleanrunDirectly
    
protected  booleanrunInternal
    
protected  booleansentFormatAlready
    
protected  booleanshowTiming
    
protected  AllocationResultAggregatorskipTransitARA
     Must use a special allocation result aggregator that does NOT include the transit (setup, wrapup) tasks in it's time calculations.
protected  booleanstopOnFailure
    
protected  inttotal
    
protected  booleanuseStoredFormat
    
protected  booleanwantMediumConfidenceOnExpansion
    
protected  XMLProcessorxmlProcessor
    


Method Summary
protected  voidappendGlobalDataFormat(Document problemFormatDoc)
     Talks to VishnuConfig to find out if there is an other data format file.
protected  voidattachAssociatedFiles(Document problemFormatDoc)
     Attaches various files to format document.
public  voidclearChangedAssets()
     Implemented for ModeListener interface

After the scheduler is informed of the changed assets, forget about them.

protected  voidclearTasks()
    
protected  UTILAssetCallbackcreateAssetCallback()
    
protected  SchedulerLifecyclecreateDirectMode()
    
protected  DirectResultHandlercreateDirectResultHandler()
    
protected  SchedulerLifecyclecreateExternalMode()
    
protected  SchedulerLifecyclecreateInternalMode()
    
protected  TaskcreateMainTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)
    
protected  TaskcreateSetupTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)
    
protected  VishnuCommcreateVishnuComm()
    
protected  VishnuConfigcreateVishnuConfig()
    
protected  VishnuDomUtilcreateVishnuDomUtil()
    
protected  TaskcreateWrapupTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)
    
protected  XMLProcessorcreateXMLProcessor()
    
protected  XMLResultHandlercreateXMLResultHandler()
    
protected  CollectiongetAllAssets()
     If you're not in incremental mode, send all assets.
protected  UTILAssetCallbackgetAssetCallback()
    
public  AssetgetAssetForKey(StringKey key)
    
public  CollectiongetChangedAssets()
    
public  XMLizergetDataXMLizer()
    
public  intgetNumAssets()
    
public  intgetNumTasks()
    
protected  VectorgetPreferences(Task parentTask, Date readyAt, Date earliest, Date best, Date latest)
    
 Adjust preferences so that the start time preference is the assigned 
 start time, and the end time preference has a best date that is the 
 assigned end time.
protected  VectorgetPrepPhrases(Task parentTask, Asset a)
     Defines how the task holds the asset for the task->asset association.
public  booleangetRunDirectly()
    
public  TaskgetTaskForKey(StringKey key)
    
public  StringgetTaskName()
    
public  CollectiongetTasks()
    
public  voidhandleAssignment(org.cougaar.planning.ldm.plan.Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, String contribs, String taskText)
    
 Should define in subclass -- create an allocation 
 The parameters are what got returned from the vishnu scheduler.
public  voidhandleChangedAssets(Enumeration changedAssets)
     Place to handle changed assets.
public  voidhandleIllFormedTask(Task t)
     Implemented for UTILTaskChecker interface.
protected  voidhandleImpossibleTasks(Collection impossibleTasks)
     Given a collection of impossible tasks, make failed disposition for each.
public  voidhandleMultiAssignment(Vector tasks, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, boolean assetWasUsedBefore)
    
 Should define in subclass -- create an aggregation
 The parameters are what got returned from the vishnu scheduler.
public  voidhandleNewAssets(Enumeration newAssets)
     Collect new assets into a set to eventually give to scheduler (after translation).
protected  voidhandleRemovedTasks(Enumeration removedTasks)
     Place to handle rescinded tasks.
protected  voidinitializeWithStoredFormat()
     little helper method called by processTasks, if using a stored object format

Reads object format if hasn't been yet.

public  booleaninterestingAsset(Asset a)
     Implemented for UTILAssetListener

OVERRIDE to see which assets you think are interesting.

public  booleaninterestingTask(Task t)
     Is the task interesting to the plugin? This is the inner-most part of the predicate.
public  voidlocalSetup()
     Here all the various runtime parameters get set.
protected  ListmakeSetupWrapupExpansion(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)
     Make expansion of mptask that attached between one and three subtasks

May attach setup and wrapup tasks, if there are specs defined for them and
if the makeSetupAndWrapupTasks boolean parameter is set.

protected  voidprepareData(List stuffToSend, Document objectFormatDoc)
     Tasks a list of tasks and the object format document and sends the data to the scheduler.
protected  voidprepareObjectFormat(List tasks)
     Automatically generate object format from Cougaar input tasks (and assets).
protected  DocumentprepareStoredObjectFormat()
     Like VishnuPlugin.prepareObjectFormat

Send the file called .dff.xml as the default object format for the problem.

public  voidprepareVishnuObjects(List tasksAndResources, Collection changedAssets, List vishnuTasks, List vishnuResources, List changedVishnuResources, Document objectFormat, SchedulingData schedData)
     Creates lists of Vishnu objects.
public  voidprocessTasks(List tasks)
    
 Heart of the plugin.
protected  voidpublishAddWithCheck(Object obj)
    
public  voidpublishSubtasks(boolean wantConfidence, Task t, List subtasks)
     This method Expands the given Task.
public  voidremoveTask(StringKey key)
    
protected  MapsendFormat(Collection templates, String assetClassName)
     Send the dataformat section of the problem to the postdata URL.
protected  voidsetUIDToObjectMap(Collection objects, Map UIDtoObject)
     Utility for setting up UID to object map.
public  voidsetupFilters()
    
protected  voidunfreezeTasks(Collection tasks)
    
protected  voidwaitForAnswer()
     Ask the mode to run, which includes handling the assignments.

Field Detail
comm
protected VishnuComm comm(Code)
manages communication with URLs or internally



config
protected VishnuConfig config(Code)
config files, gets representative tasks and assets for automatic translation



domUtil
protected VishnuDomUtil domUtil(Code)
utility functions for manipulating DOM documents



firstTemplateTasks
protected int firstTemplateTasks(Code)
how many tasks to examine to automatically determine format in automatic translation mode



incrementalScheduling
protected boolean incrementalScheduling(Code)
incremental or batch mode



localDidRehydrate
protected boolean localDidRehydrate(Code)



makeSetupAndWrapupTasks
protected boolean makeSetupAndWrapupTasks(Code)
option : create setup and wrapup tasks, in addition to assignment task



mode
protected SchedulerLifecycle mode(Code)
mode - manages scheduler lifecycle



myAssetCallback
protected UTILAssetCallback myAssetCallback(Code)
assets to use



myAssetUIDtoObject
protected Map myAssetUIDtoObject(Code)
memory of which assets are available -- used when assignments are returned



myChangedAssets
protected Set myChangedAssets(Code)
changed assets to tell the scheduler about



myNewAssets
protected Set myNewAssets(Code)
recently received assets to tell the scheduler about



myTaskUIDtoObject
protected Map myTaskUIDtoObject(Code)
memory for which tasks are being processed in this batch -- used when assignments are returned



objectFormatDoc
protected Document objectFormatDoc(Code)
object format doc, either generated or from a file



resultHandler
protected ResultHandler resultHandler(Code)
handles results, calls methods in plugin to create plan elements



runDirectly
protected boolean runDirectly(Code)
determines whether to do XML or direct translation of Cougaar objects



runInternal
protected boolean runInternal(Code)
determines whether to run in internal or external (with web server) mode



sentFormatAlready
protected boolean sentFormatAlready(Code)
sent the format already? Send it only once unless in batch mode



showTiming
protected boolean showTiming(Code)
report debug output showing timing info



skipTransitARA
protected AllocationResultAggregator skipTransitARA(Code)
Must use a special allocation result aggregator that does NOT include the transit (setup, wrapup) tasks in it's time calculations.



stopOnFailure
protected boolean stopOnFailure(Code)
controls whether to do exit on failure, sometimes useful for debugging



total
protected int total(Code)



useStoredFormat
protected boolean useStoredFormat(Code)
controls whether to use custom translation



wantMediumConfidenceOnExpansion
protected boolean wantMediumConfidenceOnExpansion(Code)



xmlProcessor
protected XMLProcessor xmlProcessor(Code)
automatic translator





Method Detail
appendGlobalDataFormat
protected void appendGlobalDataFormat(Document problemFormatDoc)(Code)
Talks to VishnuConfig to find out if there is an other data format file.
If there is, appends it to problem format doc. Adds it beneath DATAFORMAT tag.
Parameters:
  problemFormatDoc - document to add other data format to



attachAssociatedFiles
protected void attachAssociatedFiles(Document problemFormatDoc)(Code)
Attaches various files to format document.

- attach global object format file
- attach specs file
- attach ga parameters file

Parameters:
  problemFormatDoc - - document to add to




clearChangedAssets
public void clearChangedAssets()(Code)
Implemented for ModeListener interface

After the scheduler is informed of the changed assets, forget about them.




clearTasks
protected void clearTasks()(Code)
called by waitForAnswer -- we don't have to remember taskUID-to-object mappings after answer is returned



createAssetCallback
protected UTILAssetCallback createAssetCallback()(Code)
Create the standard Asset callback UTILAssetCallback that was created and has this plugin as a listener



createDirectMode
protected SchedulerLifecycle createDirectMode()(Code)



createDirectResultHandler
protected DirectResultHandler createDirectResultHandler()(Code)



createExternalMode
protected SchedulerLifecycle createExternalMode()(Code)



createInternalMode
protected SchedulerLifecycle createInternalMode()(Code)



createMainTask
protected Task createMainTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)
 create first and possibly only subtask of MPTask
 Time preferences have 
 1) the start time = earliest arrival = start of main task
 2) the best arrival time = latest arrival = end of main task
 Attaches WITH prep that shows which asset was used
 



createSetupTask
protected Task createSetupTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)
 create setup task that goes before main subtask
 Time preferences have 
 1) the start time = earliest arrival = setup start
 2) the best arrival time = latest arrival = start of main task
 Attaches WITH prep that shows which asset was used
 



createVishnuComm
protected VishnuComm createVishnuComm()(Code)



createVishnuConfig
protected VishnuConfig createVishnuConfig()(Code)



createVishnuDomUtil
protected VishnuDomUtil createVishnuDomUtil()(Code)



createWrapupTask
protected Task createWrapupTask(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)
 create wrapup task that goes after main subtask
 Time preferences have 
 1) the start time = earliest arrival = end of main task
 2) the best arrival time = latest arrival = end of wrapup
 Attaches WITH prep that shows which asset was used
 



createXMLProcessor
protected XMLProcessor createXMLProcessor()(Code)



createXMLResultHandler
protected XMLResultHandler createXMLResultHandler()(Code)



getAllAssets
protected Collection getAllAssets()(Code)
If you're not in incremental mode, send all assets.
Otherwise, only send those that have come in on the subscription add list. Collection of assets to send to Vishnu



getAssetCallback
protected UTILAssetCallback getAssetCallback()(Code)
UTILAssetCallback that was previously created and has this plugin as a listener



getAssetForKey
public Asset getAssetForKey(StringKey key)(Code)
Used when XML assignment information is returned to find matching resource asset

implemented for ResultListener interface




getChangedAssets
public Collection getChangedAssets()(Code)
Implemented for ModeListener interface

Which assets were changed since they were added as new assets? myChangedAssets set of assets on the changed list




getDataXMLizer
public XMLizer getDataXMLizer()(Code)



getNumAssets
public int getNumAssets()(Code)
implemented for ModeListener interface



getNumTasks
public int getNumTasks()(Code)
implemented for ModeListener interface



getPreferences
protected Vector getPreferences(Task parentTask, Date readyAt, Date earliest, Date best, Date latest)(Code)
 Adjust preferences so that the start time preference is the assigned 
 start time, and the end time preference has a best date that is the 
 assigned end time.  The early and late dates of the end time preference
 are the same as the first parent task. (This isn't very important, as the
 downstream allocator should just allocate to the start and best times.)
 

Parameters:
  parentTask - - parent task
Parameters:
  readyAt - - the date for the START_TIME preference
Parameters:
  best - - the best date for the END_TIME preference Vector - list of preferences for the MPTask



getPrepPhrases
protected Vector getPrepPhrases(Task parentTask, Asset a)(Code)
Defines how the task holds the asset for the task->asset association. Critical, because the allocator downstream will probably look for this prep and pluck the asset off to make the allocation or use it in some way.
Parameters:
  a - - asset to attach to task
Parameters:
  parentTask - - parent task the original set of prep phrases from the first parent task PLUS the WITHprep with the asset



getRunDirectly
public boolean getRunDirectly()(Code)
anything you added with register, you will be informed about here upon rehydration



getTaskForKey
public Task getTaskForKey(StringKey key)(Code)
Used when XML assignment information is returned to find matching resource asset

implemented for ResultListener interface




getTaskName
public String getTaskName()(Code)
implemented for ModeListener interface



getTasks
public Collection getTasks()(Code)
implemented for ModeListener interface



handleAssignment
public void handleAssignment(org.cougaar.planning.ldm.plan.Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, String contribs, String taskText)(Code)
 Should define in subclass -- create an allocation 
 The parameters are what got returned from the vishnu scheduler.
 implemented for ResultListener interface 
 

See Also:   VishnuAllocatorPlugin.handleAssignment
Parameters:
  task - task that was assigned to asset
Parameters:
  asset - asset handling task
Parameters:
  start - of main task
Parameters:
  end - of main task
Parameters:
  setupStart - start of setup task
Parameters:
  wrapupEnd - end of wrapup task



handleChangedAssets
public void handleChangedAssets(Enumeration changedAssets)(Code)
Place to handle changed assets. Does nothing by default - reports changed assets when isInfoEnabled() set.
Parameters:
  changedAssets - changed assets found in the container



handleIllFormedTask
public void handleIllFormedTask(Task t)(Code)
Implemented for UTILTaskChecker interface.

DEFAULT : Don't do anything with ill-formed tasks.
See Also:   org.cougaar.lib.filter.UTILTaskChecker.handleIllFormedTask




handleImpossibleTasks
protected void handleImpossibleTasks(Collection impossibleTasks)(Code)
Given a collection of impossible tasks, make failed disposition for each.

If stopOnFailure is true, exits.
Parameters:
  impossibleTasks - -- tasks that the scheduler couldn't figure out what to do with




handleMultiAssignment
public void handleMultiAssignment(Vector tasks, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd, boolean assetWasUsedBefore)(Code)
 Should define in subclass -- create an aggregation
 The parameters are what got returned from the vishnu scheduler.
 implemented for ResultListener interface 
 

See Also:   VishnuAggregatorPlugin.handleMultiAssignment
Parameters:
  tasks - tasks to be aggregated together and assigned to asset
Parameters:
  asset - asset handling task
Parameters:
  start - of main task
Parameters:
  end - of main task
Parameters:
  setupStart - start of setup task
Parameters:
  wrapupEnd - end of wrapup task



handleNewAssets
public void handleNewAssets(Enumeration newAssets)(Code)
Collect new assets into a set to eventually give to scheduler (after translation).
Parameters:
  newAssets - new assets found in the container



handleRemovedTasks
protected void handleRemovedTasks(Enumeration removedTasks)(Code)
Place to handle rescinded tasks.

Sends XML to unfreeze the task assignment and delete it. Asks the mode to do this.
Parameters:
  removedTasks - changed assets found in the container
See Also:   org.cougaar.lib.vishnu.client.SchedulerLifecycle.handleRemovedTasks




initializeWithStoredFormat
protected void initializeWithStoredFormat()(Code)
little helper method called by processTasks, if using a stored object format

Reads object format if hasn't been yet. Sends format if it hasn't been sent yet.




interestingAsset
public boolean interestingAsset(Asset a)(Code)
Implemented for UTILAssetListener

OVERRIDE to see which assets you think are interesting.

For instance, if you are scheduling trucks/ships/planes, you'd want to check like this : return (GLMAsset).hasContainPG ();
Parameters:
  a - asset to check boolean true if asset is interesting




interestingTask
public boolean interestingTask(Task t)(Code)
Is the task interesting to the plugin? This is the inner-most part of the predicate.
By default, it ignores tasks produced from this plugin
If you redefine this, it's good to call this using super.
Parameters:
  t - - the task begin checked
See Also:   org.cougaar.lib.callback.UTILGenericListener.interestingTask



localSetup
public void localSetup()(Code)
Here all the various runtime parameters get set. See documentation for details.



makeSetupWrapupExpansion
protected List makeSetupWrapupExpansion(Task task, Asset asset, Date start, Date end, Date setupStart, Date wrapupEnd)(Code)
Make expansion of mptask that attached between one and three subtasks

May attach setup and wrapup tasks, if there are specs defined for them and
if the makeSetupAndWrapupTasks boolean parameter is set.

The parameters are what got returned from the vishnu scheduler.
Parameters:
  task - task that was assigned to asset
Parameters:
  asset - asset handling task
Parameters:
  start - of main task
Parameters:
  end - of main task
Parameters:
  setupStart - start of setup task
Parameters:
  wrapupEnd - end of wrapup task List of subtasks created




prepareData
protected void prepareData(List stuffToSend, Document objectFormatDoc)(Code)
Tasks a list of tasks and the object format document and sends the data to the scheduler. If incremental scheduling, appends assets to the list of data if they haven't been sent before. Otherwise if not in incremental mode, always sends assets.


See Also:   org.cougaar.lib.vishnu.client.ExternalMode.prepareData
See Also:   VishnuPlugin.prepareVishnuObjects
See Also:   org.cougaar.lib.vishnu.client.ExternalMode.sendDataToVishnu
Parameters:
  stuffToSend - - initially the list of tasks to send to scheduler
Parameters:
  objectFormatDoc - - optional object format used by data xmlizersto determine types for fields when running directly




prepareObjectFormat
protected void prepareObjectFormat(List tasks)(Code)
Automatically generate object format from Cougaar input tasks (and assets).

Calls VishnuConfig to get representative sample of input tasks and assets to use as the base for automatic translation. Also gets the class name of the resource asset.

Sends the object format and creates a data xmlizer, if needed.
Parameters:
  tasks - - tasks to examine




prepareStoredObjectFormat
protected Document prepareStoredObjectFormat()(Code)
Like VishnuPlugin.prepareObjectFormat

Send the file called .dff.xml as the default object format for the problem.
Does NOT discover the object format from sampling the tasks.

This file can also be indicated by setting the parameter defaultFormat.




prepareVishnuObjects
public void prepareVishnuObjects(List tasksAndResources, Collection changedAssets, List vishnuTasks, List vishnuResources, List changedVishnuResources, Document objectFormat, SchedulingData schedData)(Code)
Creates lists of Vishnu objects.

Complains that you need to define this method by default.

Implemented for DirectResultListener interface.
Parameters:
  tasksAndResources - - Cougaar tasks and resources to translate
Parameters:
  changedAssets - - list of changed Cougaar assets
Parameters:
  vishnuTasks - - list to add Vishnu tasks to
Parameters:
  vishnuResources - - list to add Vishnu resources to
Parameters:
  changedVishnuResources - - list of changed Vishnu resources




processTasks
public void processTasks(List tasks)(Code)
 Heart of the plugin.
 Deal with the tasks that we have accumulated.
 Does: 
 1) Sets up the scheduler
 2) Sends the problem's object format, if it hasn't already been sent.
 - generated introspectively or from a file
 - will keep sending the object format if running in batch mode
 3) Prepares and sends the data (obtained from tasks and assets)
 - ask the mode to translate the tasks and assets
 4) Waits for a result (all in the mode)
 - start the scheduler
 - wait for a result
 - call handleAssignment on each returned assignment
 - deal with un-assigned tasks
 - clear tasks, ready to start on a new batch
 

Parameters:
  tasks - the tasks to handle



publishAddWithCheck
protected void publishAddWithCheck(Object obj)(Code)



publishSubtasks
public void publishSubtasks(boolean wantConfidence, Task t, List subtasks)(Code)
This method Expands the given Task.
Parameters:
  wantConfidence - set the confidence to 100% on expansion
Parameters:
  t - the task to be expanded.
Parameters:
  subtasks - the expanded subtasks



removeTask
public void removeTask(StringKey key)(Code)
implemented for ResultListener interface



sendFormat
protected Map sendFormat(Collection templates, String assetClassName)(Code)
Send the dataformat section of the problem to the postdata URL. This will define the structure of input tasks and resources, as well as the scheduling specs and the ga parameters. Each of the items in the template collection will be translated into an xml OBJECTFORMAT tag. Attaches associated files.
Parameters:
  templates - -- a collection of all the template resources and a template task.
Parameters:
  assetClassName - - used to figure out which asset is to be the Vishnu resource map of the object types to their object descriptions



setUIDToObjectMap
protected void setUIDToObjectMap(Collection objects, Map UIDtoObject)(Code)
Utility for setting up UID to object map. Uses StringKeys for speed.
Parameters:
  objects - to add to map
Parameters:
  UIDtoObject - map to populate



setupFilters
public void setupFilters()(Code)
filter for assets



unfreezeTasks
protected void unfreezeTasks(Collection tasks)(Code)



waitForAnswer
protected void waitForAnswer()(Code)
Ask the mode to run, which includes handling the assignments.

Deal with un-scheduled tasks, and then forget about them. Any tasks not handled = any which are left in the myTaskUIDtoObject map get sent to handleImpossibleTasks.
See Also:   SchedulerLifecycle.run
See Also:   ExternalMode.run
See Also:   InternalMode.run
See Also:   DirectMode.run
See Also:   VishnuPlugin.getTasks
See Also:   VishnuPlugin.handleImpossibleTasks
See Also:   VishnuPlugin.clearTasks




Fields inherited from org.cougaar.lib.filter.UTILBufferingPluginAdapter
protected AgentIdentificationService agentIDService(Code)(Java Doc)
protected UTILBufferingThread bufferingThread(Code)(Java Doc)
protected PluginAlarm currentAlarm(Code)(Java Doc)
protected UTILPreference prefHelper(Code)(Java Doc)
protected QuiescenceReportService qService(Code)(Java Doc)
protected Schedulable schedulable(Code)(Java Doc)
protected ThreadService threadService(Code)(Java Doc)
protected UTILVerify verify(Code)(Java Doc)

Methods inherited from org.cougaar.lib.filter.UTILBufferingPluginAdapter
protected UTILBufferingThread createBufferingThread()(Code)(Java Doc)
abstract protected UTILFilterCallback createThreadCallback(UTILGenericListener listener)(Code)(Java Doc)
public void examineBufferAgainIn(long delayTime)(Code)(Java Doc)
protected void execute()(Code)(Java Doc)
protected UTILBufferingThread getBufferingThread()(Code)(Java Doc)
public boolean interestingTask(Task t)(Code)(Java Doc)
public boolean isTaskWellFormed(Task t)(Code)(Java Doc)
public void localSetup()(Code)(Java Doc)
abstract public void processTasks(List tasks)(Code)(Java Doc)
protected void reportIllFormedTask(Task t)(Code)(Java Doc)
public void resume()(Code)(Java Doc)
final public void setQuiescenceReportService(QuiescenceReportService qService)(Code)(Java Doc)
public void setupFilters()(Code)(Java Doc)
public void wakeUp()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.