Java Doc for UTILAllocatorPluginAdapter.java in  » Science » Cougaar12_4 » org » cougaar » lib » filter » 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.filter 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.cougaar.lib.filter.UTILPluginAdapter
   org.cougaar.lib.filter.UTILBufferingPluginAdapter
      org.cougaar.lib.filter.UTILAllocatorPluginAdapter

All known Subclasses:   org.cougaar.lib.filter.UTILSingleTaskAllocatorPlugin,
UTILAllocatorPluginAdapter
abstract public class UTILAllocatorPluginAdapter extends UTILBufferingPluginAdapter implements UTILAllocatorPlugin(Code)
 By default listens for all Assets (please override
 createAssetCallback to make more specific).  
 Also listens for allocations.
 Fill in empty functions as needed to add functionality
 Abstract because these are undefined:
 processTasks -- different for each plugin flavor
 


Field Summary
protected  UTILAllocatealloc
    
protected  UTILAllocationCallbackmyAllocCallback
    
protected  UTILAssetCallbackmyAssetCallback
    
protected  UTILWorkflowCallbackmyWorkflowCallback
    


Method Summary
protected  UTILAllocationCallbackcreateAllocCallback()
     Override to replace with a callback that has a different predicate or different behaviour when triggered.
protected  UTILAssetCallbackcreateAssetCallback()
    
 Override to replace with a callback that has a different predicate
 or different behaviour when triggered.
 PLEASE override this -- this is mainly here for backward compatibility.
 I.e.
protected  UTILFilterCallbackcreateThreadCallback(UTILGenericListener bufferingThread)
     Provide the callback that is paired with the buffering thread, which is a listener.
protected  UTILAllocationCallbackgetAllocCallback()
    
protected  UTILAssetCallbackgetAssetCallback()
    
final protected  IteratorgetAssets()
    
 Utility method for finding all resource assets.
public  voidgetEnvData()
     Reads delayBeforeAllocRemoval from environment files.
protected  UTILFilterCallbackgetWorkflowCallback()
    
public  voidhandleChangedAssets(Enumeration changedAssets)
    
 Place to handle changed assets.
public  voidhandleIllFormedTask(Task t)
    
 Implemented for UTILBufferingPlugin
 Got an ill-formed task, now handle it, by
 publishing a failed allocation for the task.
public  voidhandleNewAssets(Enumeration newAssets)
    
 Place to handle new assets.
public  voidhandleRemovedAlloc(Allocation alloc)
    
 Called when an allocation is removed from the cluster.
 I.e.
public  booleanhandleRescindedAlloc(Allocation alloc)
    
 Implemented for UTILAllocationListener
 Defines re-allocation of a rescinded task.
public  voidhandleSuccessfulAlloc(Allocation alloc)
    
 Implemented for UTILAllocationListener
 Called automatically by the UTILAllocationCallback 
 if the allocation has changed but it does NOT need 
 to be rescinded.
public  booleaninterestingAsset(Asset a)
    
public  booleaninterestingNotification(Task t)
    
public  booleanneedToRescind(Allocation alloc)
    
 Implemented for UTILAllocationListener
 Defines conditions for rescinding tasks.
 When returns TRUE, handleRescindedAlloc is called.
public  voidpublishRemovalOfAllocation(Allocation alloc)
    
 Implemented for UTILAllocationListener
 Public version of publishRemove
 Called by UTILAllocationCallback.reactToChangedAlloc.
public  voidsetupFilters()
    
 The idea is to add subscriptions (via the filterCallback), and when 
 they change, to have the callback react to the change, and tell 
 the listener (many times the plugin) what to do.

Field Detail
alloc
protected UTILAllocate alloc(Code)



myAllocCallback
protected UTILAllocationCallback myAllocCallback(Code)



myAssetCallback
protected UTILAssetCallback myAssetCallback(Code)



myWorkflowCallback
protected UTILWorkflowCallback myWorkflowCallback(Code)





Method Detail
createAllocCallback
protected UTILAllocationCallback createAllocCallback()(Code)
Override to replace with a callback that has a different predicate or different behaviour when triggered.



createAssetCallback
protected UTILAssetCallback createAssetCallback()(Code)
 Override to replace with a callback that has a different predicate
 or different behaviour when triggered.
 PLEASE override this -- this is mainly here for backward compatibility.
 I.e. we shouldn't get all the assets of the cluster and then iterate over
 them, testing them with instanceof to get the assets we want.  We should
 use a more specific callback filter/predicate.
 



createThreadCallback
protected UTILFilterCallback createThreadCallback(UTILGenericListener bufferingThread)(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 WorkflowCallback with the buffering thread as its listener



getAllocCallback
protected UTILAllocationCallback getAllocCallback()(Code)



getAssetCallback
protected UTILAssetCallback getAssetCallback()(Code)



getAssets
final protected Iterator getAssets()(Code)
 Utility method for finding all resource assets. 
 In general, it would be better if plugins could use more
 specific filters and so this call would return a restricted set of
 assets. 
 At the very least, 
 cluster assets can be divided between organizational assets
 and physical assets. 
 Enumeration of ALL assets found in container



getEnvData
public void getEnvData()(Code)
Reads delayBeforeAllocRemoval from environment files.



getWorkflowCallback
protected UTILFilterCallback getWorkflowCallback()(Code)



handleChangedAssets
public void handleChangedAssets(Enumeration changedAssets)(Code)
 Place to handle changed assets.
 Does nothing by default.
 

Parameters:
  changedAssets - changed assets found in the container



handleIllFormedTask
public void handleIllFormedTask(Task t)(Code)
 Implemented for UTILBufferingPlugin
 Got an ill-formed task, now handle it, by
 publishing a failed allocation for the task.
 

Parameters:
  t - badly-formed task to handle



handleNewAssets
public void handleNewAssets(Enumeration newAssets)(Code)
 Place to handle new assets.
 Does nothing by default.
 

Parameters:
  newAssets - new assets found in the container



handleRemovedAlloc
public void handleRemovedAlloc(Allocation alloc)(Code)
 Called when an allocation is removed from the cluster.
 I.e. an upstream cluster removed an allocation, and this 
 rescind has resulted in this allocation being removed.
 If the plugin maintains some local state of the availability
 of assets, it should update them here.
 Does nothing by default.
 



handleRescindedAlloc
public boolean handleRescindedAlloc(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Defines re-allocation of a rescinded task.  
 Overriders need to take into consideration that 
 the asset chosen last time is not available this time.
 Note that updateAllocationResult is called automatically by
 the UTILAllocationCallback if the allocation has changed 
 (typically if its allocation result has changed) 
 but it does NOT need to be rescinded.
 Called by UTILAllocationCallback.reactToChangedAlloc.
 Only called when needToRescind returns TRUE.
 See comment on needToRescind.
 Does nothing by default.
 

Parameters:
  alloc - the allocation that should be rescinded
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc
See Also:   UTILAllocatorPluginAdapter.needToRescind



handleSuccessfulAlloc
public void handleSuccessfulAlloc(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Called automatically by the UTILAllocationCallback 
 if the allocation has changed but it does NOT need 
 to be rescinded. 
 updateAllocationResult is called first and then this method 
 gets called.
 Called by UTILAllocationCallback.reactToChangedAlloc.
 Only called when needToRescind returns FALSE.
 See comment on needToRescind.
 Does nothing by default.
 

Parameters:
  alloc - the allocation that was successful
See Also:   UTILPluginAdapter.updateAllocationResult
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc
See Also:   UTILAllocatorPluginAdapter.needToRescind



interestingAsset
public boolean interestingAsset(Asset a)(Code)
 Implemented for UTILAssetListener
 OVERRIDE to see which assets you
 think are interesting
 

Parameters:
  a - asset to check for notification boolean true if asset is interesting



interestingNotification
public boolean interestingNotification(Task t)(Code)
 Implemented for UTILAllocationListener
 OVERRIDE to see which task notifications you
 think are interesting
 

Parameters:
  t - task to check for notification boolean true if task is interesting



needToRescind
public boolean needToRescind(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Defines conditions for rescinding tasks.
 When returns TRUE, handleRescindedAlloc is called. Returns 
 TRUE when downstream, a FailedAllocation is made.
 WARNING WARNING WARNING: returning TRUE can easily lead 
 to an infinite loop consisting of try again-fail-try again, etc.  
 Subclasses should return FALSE even when the allocation 
 fails if they can't do anything differently the second time. 
 Returning FALSE makes the failure get reported to its 
 superior.
 If in making an allocation, a preference
 threshold is exceeded, the returned plan element will be
 a FailedAllocation (see UTILAllocate.makeAllocation ()).
 TOPS does not create any allocations with 
 AllocationResults w/ isSuccess = false, but COUGAAR will roll
 up the results of a workflow, and create an AllocResult
 w/ isSuccess = False if it contains a FailedAllocation.
 Called by UTILAllocationCallback.reactToChangedAlloc.
 

Parameters:
  alloc - the allocation to check boolean true if the allocation need to be rescindedAlso returns false if there is no report alloc resultattached to allocation
See Also:   UTILAllocatorPluginAdapter.handleRescindedAlloc
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc
See Also:   org.cougaar.lib.util.UTILAllocate.makeAllocation
See Also:   org.cougaar.lib.util.UTILAllocate.isFailedPE



publishRemovalOfAllocation
public void publishRemovalOfAllocation(Allocation alloc)(Code)
 Implemented for UTILAllocationListener
 Public version of publishRemove
 Called by UTILAllocationCallback.reactToChangedAlloc.
 FIXIT! -- if you remove the try-catch block, sometimes will see
 reset claim exceptions.
 

Parameters:
  alloc - Allocation to remove from cluster's memory
See Also:   org.cougaar.lib.callback.UTILAllocationCallback.reactToChangedAlloc



setupFilters
public void setupFilters()(Code)
 The idea is to add subscriptions (via the filterCallback), and when 
 they change, to have the callback react to the change, and tell 
 the listener (many times the plugin) what to do.
 Override and call super to add new filters, or override 
 createXXXCallback to change callback behaviour.
 By default adds asset callback and allocation callback after
 creating them.
 

See Also:   UTILAllocatorPluginAdapter.createAssetCallback
See Also:   UTILAllocatorPluginAdapter.createAllocCallback



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)

Fields inherited from org.cougaar.lib.filter.UTILPluginAdapter
protected double HIGH_CONFIDENCE(Code)(Java Doc)
protected UTILAggregate aggregateHelper(Code)(Java Doc)
protected UTILAllocate allocHelper(Code)(Java Doc)
protected UTILAsset assetHelper(Code)(Java Doc)
protected boolean checkedDidRehydrate(Code)(Java Doc)
protected UTILExpand expandHelper(Code)(Java Doc)
protected PlanningFactory ldmf(Code)(Java Doc)
protected LoggingService logger(Code)(Java Doc)
protected String myClusterName(Code)(Java Doc)
protected String myName(Code)(Java Doc)
protected ParamMap myParams(Code)(Java Doc)
protected Vector mySubscriptions(Code)(Java Doc)
protected ParamParser paramParser(Code)(Java Doc)
protected PersistentState persistentState(Code)(Java Doc)
protected UTILPreference prefHelper(Code)(Java Doc)
protected UTILPrepPhrase prepHelper(Code)(Java Doc)
protected Plan realityPlan(Code)(Java Doc)
protected boolean showinfoOnFailure(Code)(Java Doc)
protected boolean skipLowConfidence(Code)(Java Doc)
protected UTILVerify verifyHelper(Code)(Java Doc)

Methods inherited from org.cougaar.lib.filter.UTILPluginAdapter
public void addFilter(UTILFilterCallback callbackObj)(Code)(Java Doc)
protected ParamMap createParamTable(Vector envParams, MessageAddress ident)(Code)(Java Doc)
protected void debug(String message)(Code)(Java Doc)
protected boolean didSpawn()(Code)(Java Doc)
protected void error(String message)(Code)(Java Doc)
protected void execute()(Code)(Java Doc)
protected void fatal(String message)(Code)(Java Doc)
protected PersistentState findState()(Code)(Java Doc)
protected String getClassName()(Code)(Java Doc)
protected String getClassName(Object obj)(Code)(Java Doc)
public String getClusterName()(Code)(Java Doc)
public void getEnvData()(Code)(Java Doc)
final protected LDMService getLDMService()(Code)(Java Doc)
protected LoggingService getLoggingService()(Code)(Java Doc)
public ParamMap getMyParams()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
protected MessageAddress getOriginalAgentID()(Code)(Java Doc)
protected void info(String message)(Code)(Java Doc)
protected boolean isDebugEnabled()(Code)(Java Doc)
protected boolean isErrorEnabled()(Code)(Java Doc)
protected boolean isFatalEnabled()(Code)(Java Doc)
protected boolean isInfoEnabled()(Code)(Java Doc)
protected boolean isWarnEnabled()(Code)(Java Doc)
protected void justRehydrated()(Code)(Java Doc)
public void localSetup()(Code)(Java Doc)
public void preFilterSetup()(Code)(Java Doc)
final protected void publishAdd(Object o)(Code)(Java Doc)
final protected void publishChange(Object o)(Code)(Java Doc)
final protected void publishRemove(Object o)(Code)(Java Doc)
protected void registerPersistentState(Object obj)(Code)(Java Doc)
protected void rehydrateState(List stuff)(Code)(Java Doc)
public void removeFilter(UTILFilterCallback callbackObj)(Code)(Java Doc)
final public void setLDMService(LDMService s)(Code)(Java Doc)
public void setLoggingService(LoggingService bs)(Code)(Java Doc)
public void setupFilters()(Code)(Java Doc)
final protected void setupSubscriptions()(Code)(Java Doc)
public IncrementalSubscription subscribeFromCallback(UnaryPredicate pred)(Code)(Java Doc)
public IncrementalSubscription subscribeFromCallback(UnaryPredicate pred, Collection specialContainer)(Code)(Java Doc)
public void updateAllocationResult(PlanElement cpe)(Code)(Java Doc)
protected void warn(String message)(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.