Java Doc for PluginAdapter.java in  » Science » Cougaar12_4 » org » cougaar » planning » plugin » legacy » 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.planning.plugin.legacy 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.util.GenericStateModelAdapter
      org.cougaar.planning.plugin.legacy.PluginAdapter

All known Subclasses:   org.cougaar.planning.plugin.legacy.SimplePlugin,  org.cougaar.mlm.examples.PrototypeProviderPluginExample,  org.cougaar.planning.plugin.legacy.ThinPlugin,  org.cougaar.planning.plugin.legacy.SingleThreadedPlugin,  org.cougaar.mlm.examples.PropertyProviderPluginExample,
PluginAdapter
abstract public class PluginAdapter extends GenericStateModelAdapter implements PluginStateModel,Component,BlackboardClient,PluginBase(Code)

Inner Class :protected class Delegate implements PluginDelegate
Inner Class :public class PluginAlarm implements Alarm
Inner Class :abstract protected class Threading implements GenericStateModel
Inner Class :protected class NoThreading extends Threading
Inner Class :protected class OneShotThreading extends Threading
Inner Class :protected class SharedThreading extends Threading
Inner Class :protected class SingleThreading extends Threading implements Runnable

Field Summary
final public static  intNO_THREAD
    
final public static  intONESHOT_THREAD
    
final public static  intSHARED_THREAD
    
final public static  intSINGLE_THREAD
    
final public static  intUNSPECIFIED_THREAD
    
final public static  longWAKE_LATENCY
    
protected  StringblackboardClientName
    
protected  LDMServesPlugintheLDM
    
protected  PlanningFactorytheLDMF
    

Constructor Summary
public  PluginAdapter()
    

Method Summary
final protected  voidchooseThreadingModel(int m)
     Set the current choice of threading model.
protected  booleanclaim(Object o)
     Attempt to stake a claim on a logplan object, essentially telling everyone else that you and only you will be disposing, modifying, etc.
final protected  voidcloseTransaction()
    
final protected  voidcloseTransaction(boolean resetp)
    
final protected  voidcloseTransactionDontReset()
    
protected  PluginDelegatecreateDelegate()
    
protected  ThreadingcreateThreadingModel()
     create a Threading model object as specified by the plugin. The default implementation creates a Threading object based on the value of threadingChoice. The default choice is to use a SharedThreading model, which shares thread of execution with others of the same sort in the agent. Most plugins can ignore this altogether.
public  longcurrentTimeMillis()
     What is the current Scenario time? Note that this facility is not appropriate to use for load-balancing purposes, as scenario time is discontinuous and may even stop.
protected  voidcycle()
    
public  booleandidRehydrate()
    
public  booleandidRehydrate(BlackboardService subscriber)
    
final protected  MessageAddressgetAgentIdentifier()
    
final protected  AlarmServicegetAlarmService()
    
final protected  PluginBindingSitegetBindingSite()
    
public  StringgetBlackboardClientName()
    
final public  BlackboardServicegetBlackboardService()
     Safely return our BlackboardService Plugin.load() must have completed in order for the value to be defined.
final protected  ClusterServesPlugingetCluster()
     let subclasses get ahold of the cluster without having to catch it at load time.
protected  ConfigFindergetConfigFinder()
    
public  DategetDate()
     what is the current (COUGAAR) time as a Date object? Note: currentTimeMillis() is preferred, as it gives more control over timezone, calendar, etc.
final protected  PluginDelegategetDelegate()
    
final protected  DemoControlServicegetDemoControlService()
    
final public  DomainServicegetDomainService()
    
final protected  PlanningFactorygetFactory()
    
final protected  FactorygetFactory(String s)
    
final protected  LDMServesPlugingetLDM()
    
final protected  LDMServicegetLDMService()
    
final protected  MessageAddressgetMessageAddress()
    
public  VectorgetParameters()
     get any Plugin parameters passed by the plugin instantiator.
final public  PrototypeRegistryServicegetPrototypeRegistryService()
    
public  intgetPublishAddedCount()
    
public  intgetPublishChangedCount()
    
public  intgetPublishRemovedCount()
    
final protected  SchedulerServicegetSchedulerService()
    
protected  BlackboardServicegetSubscriber()
    
public  intgetSubscriptionCount()
    
public  intgetSubscriptionSize()
    
final protected  intgetThreadingChoice()
     the current choice of threading model.
final protected  ThreadinggetThreadingModel()
    
final protected  UIDServergetUIDServer()
    
final public  UIDServicegetUIDService()
    
public  voidinitialize()
    
public  voidload()
    
public  voidload(Object object)
     Load the plugin.
final protected  voidopenTransaction()
    
public  longparseInterval(String param)
    
public  longparseIntervalParameter(int paramIndex)
    
public  voidplugin_cycle()
    
public  voidplugin_prerun()
    
protected  voidprerun()
    
final protected  voidpublishAdd(Object o)
    
final protected  voidpublishChange(Object o)
    
final protected  voidpublishChange(Object o, Collection changes)
     mark an element of the Plan as changed. Behavior is not defined if the object is not a member of the plan. There is no need to call this if the object was added or removed, only if the contents of the object itself has been changed. The changes parameter describes a set of changes made to the object beyond those tracked automatically by the object class (see the object class documentation for a description of which types of changes are tracked).
final protected  voidpublishRemove(Object o)
    
final protected  Collectionquery(UnaryPredicate isMember)
     Issue a query against the logplan.
public  voidresume()
    
final public  voidsetAgentIdentificationService(AgentIdentificationService ais)
    
final public  voidsetAlarmService(AlarmService s)
    
final public  voidsetAwakened(boolean value)
    
final public  voidsetBindingSite(BindingSite bs)
    
public  voidsetBlackboardService(BlackboardService s)
    
final public  voidsetDemoControlService(DemoControlService dcs)
    
public  voidsetDomainService(DomainService ds)
    
final public  voidsetLDMService(LDMService s)
    
public  voidsetParameter(Object param)
    
public  voidsetPrototypeRegistryService(PrototypeRegistryService prs)
    
final public  voidsetSchedulerService(SchedulerService ss)
    
final protected  voidsetThreadingChoice(int m)
     Set the current choice of threading model.
final protected  voidsetThreadingModel(Threading t)
    
public  voidsetUIDService(UIDService us)
    
public  voidstart()
    
public  voidstartThreadingModel()
    
final protected  Subscriptionsubscribe(UnaryPredicate isMember)
     Request a subscription to all objects for which isMember.execute(object) is true.
final protected  Subscriptionsubscribe(UnaryPredicate isMember, Collection realCollection)
     like subscribe(UnaryPredicate), but allows specification of some other type of Collection object as the internal representation of the collection.
final protected  Subscriptionsubscribe(UnaryPredicate isMember, boolean isIncremental)
    
final protected  Subscriptionsubscribe(UnaryPredicate isMember, Collection realCollection, boolean isIncremental)
     Alias for getBlackboardService().subscribe(UnaryPredicate, Collection, boolean);
Parameters:
  isMember - a predicate to execute to ascertainmembership in the collection of the subscription.
Parameters:
  realCollection - a container to hold the contents of the subscription.
Parameters:
  isIncremental - should be true if an incremental subscription is desired.An incremental subscription provides access to the incremental changes to the subscription.
public  voidsuspend()
    
public  StringtoString()
    
final protected  booleantryOpenTransaction()
    
protected  voidunclaim(Object o)
     Release an existing claim on a logplan object.
final protected  voidunsubscribe(Subscription subscription)
     Cancels the given Subscription which must have been returned by a previous invocation of subscribe().
final public  voidwake()
     Hook which allows a plugin thread to request that the primary plugin thread (the execute() method) be called. Generally used when you want the plugin to be stimulated by some non-internal state change ( e.g.
public  AlarmwakeAfter(long delayTime)
     Convenience method to specify period of time to wait before stimulating plugin (based on COUGAAR scenario time).
public  AlarmwakeAfterRealTime(long delayTime)
     like wakeAfter() except always in real (wallclock) time.
public  AlarmwakeAt(long wakeTime)
     Convenience method to specify given time to stimulate plugin. (based on COUGAAR scenario time).
public  AlarmwakeAtRealTime(long wakeTime)
     like wakeAt() except always in real (wallclock) time.
protected  booleanwasAwakened()
     true IFF were we awakened explicitly (i.e.

Field Detail
NO_THREAD
final public static int NO_THREAD(Code)



ONESHOT_THREAD
final public static int ONESHOT_THREAD(Code)



SHARED_THREAD
final public static int SHARED_THREAD(Code)



SINGLE_THREAD
final public static int SINGLE_THREAD(Code)



UNSPECIFIED_THREAD
final public static int UNSPECIFIED_THREAD(Code)



WAKE_LATENCY
final public static long WAKE_LATENCY(Code)
minimum time (in millis) which wake functions like to pause for *



blackboardClientName
protected String blackboardClientName(Code)



theLDM
protected LDMServesPlugin theLDM(Code)



theLDMF
protected PlanningFactory theLDMF(Code)
keep this around for compatability with old plugins *




Constructor Detail
PluginAdapter
public PluginAdapter()(Code)




Method Detail
chooseThreadingModel
final protected void chooseThreadingModel(int m)(Code)
Set the current choice of threading model. Will have no effect if the threading model has already been acted on.



claim
protected boolean claim(Object o)(Code)
Attempt to stake a claim on a logplan object, essentially telling everyone else that you and only you will be disposing, modifying, etc. it. Calls Claimable.tryClaim if the object is Claimable. true IFF success.



closeTransaction
final protected void closeTransaction() throws SubscriberException(Code)



closeTransaction
final protected void closeTransaction(boolean resetp) throws SubscriberException(Code)



closeTransactionDontReset
final protected void closeTransactionDontReset() throws SubscriberException(Code)



createDelegate
protected PluginDelegate createDelegate()(Code)



createThreadingModel
protected Threading createThreadingModel()(Code)
create a Threading model object as specified by the plugin. The default implementation creates a Threading object based on the value of threadingChoice. The default choice is to use a SharedThreading model, which shares thread of execution with others of the same sort in the agent. Most plugins can ignore this altogether. Most that want to select different behavior should call chooseThreadingModel() in their constructer. Plugins which implement their own threading model will need to override createThreadingModel. createThreadingModel is called late in PluginBinder.load(). if an extending plugin class wishes to examine or alter the threading model object, it will be available only when PluginBinder.load() returns, which is usually called by the extending plugin classes overriding load() method. The constructed Threading object is initialized by PluginBinder.start().



currentTimeMillis
public long currentTimeMillis()(Code)
What is the current Scenario time? Note that this facility is not appropriate to use for load-balancing purposes, as scenario time is discontinuous and may even stop.



cycle
protected void cycle()(Code)
override to define cycle behavior *



didRehydrate
public boolean didRehydrate()(Code)



didRehydrate
public boolean didRehydrate(BlackboardService subscriber)(Code)



getAgentIdentifier
final protected MessageAddress getAgentIdentifier()(Code)



getAlarmService
final protected AlarmService getAlarmService()(Code)



getBindingSite
final protected PluginBindingSite getBindingSite()(Code)



getBlackboardClientName
public String getBlackboardClientName()(Code)



getBlackboardService
final public BlackboardService getBlackboardService()(Code)
Safely return our BlackboardService Plugin.load() must have completed in order for the value to be defined.



getCluster
final protected ClusterServesPlugin getCluster()(Code)
let subclasses get ahold of the cluster without having to catch it at load time. May throw a runtime exception if the plugin hasn't been loaded yet.



getConfigFinder
protected ConfigFinder getConfigFinder()(Code)



getDate
public Date getDate()(Code)
what is the current (COUGAAR) time as a Date object? Note: currentTimeMillis() is preferred, as it gives more control over timezone, calendar, etc. Note that this facility is not appropriate to use for load-balancing purposes, as scenario time is discontinuous and may even stop.



getDelegate
final protected PluginDelegate getDelegate()(Code)
an object that exposes the protected plugin methodsas publics.



getDemoControlService
final protected DemoControlService getDemoControlService()(Code)



getDomainService
final public DomainService getDomainService()(Code)



getFactory
final protected PlanningFactory getFactory()(Code)



getFactory
final protected Factory getFactory(String s)(Code)



getLDM
final protected LDMServesPlugin getLDM()(Code)



getLDMService
final protected LDMService getLDMService()(Code)



getMessageAddress
final protected MessageAddress getMessageAddress()(Code)



getParameters
public Vector getParameters()(Code)
get any Plugin parameters passed by the plugin instantiator. If they haven't been set, will return null. Should be set between plugin construction and initialization.



getPrototypeRegistryService
final public PrototypeRegistryService getPrototypeRegistryService()(Code)



getPublishAddedCount
public int getPublishAddedCount()(Code)



getPublishChangedCount
public int getPublishChangedCount()(Code)



getPublishRemovedCount
public int getPublishRemovedCount()(Code)



getSchedulerService
final protected SchedulerService getSchedulerService()(Code)



getSubscriber
protected BlackboardService getSubscriber()(Code)
alias for getBlackboardService *



getSubscriptionCount
public int getSubscriptionCount()(Code)



getSubscriptionSize
public int getSubscriptionSize()(Code)



getThreadingChoice
final protected int getThreadingChoice()(Code)
the current choice of threading model. *



getThreadingModel
final protected Threading getThreadingModel()(Code)



getUIDServer
final protected UIDServer getUIDServer()(Code)



getUIDService
final public UIDService getUIDService()(Code)



initialize
public void initialize()(Code)
Component Model AND GenericStateModel initialization *



load
public void load() throws StateModelException(Code)



load
public void load(Object object)(Code)
Load the plugin. No longer pays any attention to the passed object, as it will now always be null.



openTransaction
final protected void openTransaction()(Code)



parseInterval
public long parseInterval(String param)(Code)



parseIntervalParameter
public long parseIntervalParameter(int paramIndex)(Code)
Make this utility trivially accessible to plugins



plugin_cycle
public void plugin_cycle()(Code)
called from PluginBinder *



plugin_prerun
public void plugin_prerun()(Code)
called from PluginBinder *



prerun
protected void prerun()(Code)
override to define prerun behavior *



publishAdd
final protected void publishAdd(Object o)(Code)



publishChange
final protected void publishChange(Object o)(Code)



publishChange
final protected void publishChange(Object o, Collection changes)(Code)
mark an element of the Plan as changed. Behavior is not defined if the object is not a member of the plan. There is no need to call this if the object was added or removed, only if the contents of the object itself has been changed. The changes parameter describes a set of changes made to the object beyond those tracked automatically by the object class (see the object class documentation for a description of which types of changes are tracked). Any additional changes are merged in after automatically collected reports.
Parameters:
  changes - a set of ChangeReport instances or null.



publishRemove
final protected void publishRemove(Object o)(Code)



query
final protected Collection query(UnaryPredicate isMember)(Code)
Issue a query against the logplan. Similar in function to opening a new subscription, getting the results and immediately closing the subscription, but can be implemented much more efficiently. Note: the initial implementation actually does exactly this.



resume
public void resume() throws StateModelException(Code)



setAgentIdentificationService
final public void setAgentIdentificationService(AgentIdentificationService ais)(Code)



setAlarmService
final public void setAlarmService(AlarmService s)(Code)



setAwakened
final public void setAwakened(boolean value)(Code)
For adapter use only *



setBindingSite
final public void setBindingSite(BindingSite bs)(Code)



setBlackboardService
public void setBlackboardService(BlackboardService s)(Code)



setDemoControlService
final public void setDemoControlService(DemoControlService dcs)(Code)



setDomainService
public void setDomainService(DomainService ds)(Code)



setLDMService
final public void setLDMService(LDMService s)(Code)



setParameter
public void setParameter(Object param)(Code)



setPrototypeRegistryService
public void setPrototypeRegistryService(PrototypeRegistryService prs)(Code)



setSchedulerService
final public void setSchedulerService(SchedulerService ss)(Code)



setThreadingChoice
final protected void setThreadingChoice(int m)(Code)
Set the current choice of threading model. Will have no effect if the threading model has already been acted on.



setThreadingModel
final protected void setThreadingModel(Threading t)(Code)



setUIDService
public void setUIDService(UIDService us)(Code)



start
public void start() throws StateModelException(Code)



startThreadingModel
public void startThreadingModel()(Code)



subscribe
final protected Subscription subscribe(UnaryPredicate isMember)(Code)
Request a subscription to all objects for which isMember.execute(object) is true. The returned Collection is a transactionally-safe set of these objects which is guaranteed not to change out from under you during run() execution. subscribe() may be called any time after load() completes. NOTE: we'll probably want a "new things" sort of collection for expanders. Alias for getBlackboardService().subscribe(UnaryPredicate);



subscribe
final protected Subscription subscribe(UnaryPredicate isMember, Collection realCollection)(Code)
like subscribe(UnaryPredicate), but allows specification of some other type of Collection object as the internal representation of the collection. Alias for getBlackboardService().subscribe(UnaryPredicate, Collection);



subscribe
final protected Subscription subscribe(UnaryPredicate isMember, boolean isIncremental)(Code)
Alias for getBlackboardService().subscribe(UnaryPredicate, boolean);



subscribe
final protected Subscription subscribe(UnaryPredicate isMember, Collection realCollection, boolean isIncremental)(Code)
Alias for getBlackboardService().subscribe(UnaryPredicate, Collection, boolean);
Parameters:
  isMember - a predicate to execute to ascertainmembership in the collection of the subscription.
Parameters:
  realCollection - a container to hold the contents of the subscription.
Parameters:
  isIncremental - should be true if an incremental subscription is desired.An incremental subscription provides access to the incremental changes to the subscription. the Subsciption.
See Also:   org.cougaar.core.blackboard.Subscriber.subscribe
See Also:   org.cougaar.core.blackboard.Subscription



suspend
public void suspend() throws StateModelException(Code)



toString
public String toString()(Code)



tryOpenTransaction
final protected boolean tryOpenTransaction()(Code)



unclaim
protected void unclaim(Object o)(Code)
Release an existing claim on a logplan object. This is likely to thow an exception if the object had not previously been (successfully) claimed by this plugin.



unsubscribe
final protected void unsubscribe(Subscription subscription)(Code)
Cancels the given Subscription which must have been returned by a previous invocation of subscribe(). Alias for getBlackboardService().unsubscribe(Subscription).
Parameters:
  subscription - the subscription to cancel
See Also:   org.cougaar.core.blackboard.Subscriber.unsubscribe



wake
final public void wake()(Code)
Hook which allows a plugin thread to request that the primary plugin thread (the execute() method) be called. Generally used when you want the plugin to be stimulated by some non-internal state change ( e.g. when a timer goes off, database activity, offline server activity, etc.) For plugin use only; No longer called by the infrastructure.



wakeAfter
public Alarm wakeAfter(long delayTime)(Code)
Convenience method to specify period of time to wait before stimulating plugin (based on COUGAAR scenario time). Note that this facility is not appropriate to use for load-balancing purposes, as scenario time is discontinuous and may even stop.
Parameters:
  delayTime - (Scenario) milliseconds to wait before waking.



wakeAfterRealTime
public Alarm wakeAfterRealTime(long delayTime)(Code)
like wakeAfter() except always in real (wallclock) time.



wakeAt
public Alarm wakeAt(long wakeTime)(Code)
Convenience method to specify given time to stimulate plugin. (based on COUGAAR scenario time). Note that this facility is not appropriate to use for load-balancing purposes, as scenario time is discontinuous and may even stop.
Parameters:
  wakeTime - actual scenario time to wake in milliseconds.



wakeAtRealTime
public Alarm wakeAtRealTime(long wakeTime)(Code)
like wakeAt() except always in real (wallclock) time.



wasAwakened
protected boolean wasAwakened()(Code)
true IFF were we awakened explicitly (i.e. we were asked to run even if no subscription activity has happened). The value is valid only while running in the main plugin thread.



Methods inherited from org.cougaar.util.GenericStateModelAdapter
final public int getModelState()(Code)(Java Doc)
public synchronized void halt() throws StateModelException(Code)(Java Doc)
public synchronized void initialize() throws StateModelException(Code)(Java Doc)
public synchronized void load() throws StateModelException(Code)(Java Doc)
public synchronized void resume() throws StateModelException(Code)(Java Doc)
public synchronized void start() throws StateModelException(Code)(Java Doc)
public synchronized void stop() throws StateModelException(Code)(Java Doc)
public synchronized void suspend() throws StateModelException(Code)(Java Doc)
protected synchronized void transitState(String op, int expectedState, int endState) throws StateModelException(Code)(Java Doc)
public synchronized void unload() throws StateModelException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.