org.cougaar.pizza.plugin
Class ProcessOrderPlugin

java.lang.Object
  extended byorg.cougaar.util.GenericStateModelAdapter
      extended byorg.cougaar.core.blackboard.BlackboardClientComponent
          extended byorg.cougaar.core.plugin.ComponentPlugin
              extended byorg.cougaar.pizza.plugin.ProcessOrderPlugin
All Implemented Interfaces:
org.cougaar.core.blackboard.BlackboardClient, org.cougaar.core.component.Component, org.cougaar.util.GenericStateModel, org.cougaar.core.plugin.PluginBase

public class ProcessOrderPlugin
extends org.cougaar.core.plugin.ComponentPlugin

This plugin processes incoming pizza Order Tasks at the pizza provider agents. It matches the topping requirements (PropertyGroups on the DirectObject of the Task) with the capabilities of its Kitchen (again, PropertyGroups on the Asset) to decide if it can handle the Order.


Nested Class Summary
 
Nested classes inherited from class org.cougaar.core.blackboard.BlackboardClient
org.cougaar.core.blackboard.BlackboardClient.Local
 
Field Summary
 
Fields inherited from class org.cougaar.core.blackboard.BlackboardClientComponent
agentId, agentIdentificationService, alarmService, blackboard, blackboardClientName
 
Fields inherited from interface org.cougaar.core.plugin.PluginBase
INSERTION_POINT
 
Fields inherited from interface org.cougaar.util.GenericStateModel
ACTIVE, IDLE, LOADED, UNINITIALIZED, UNLOADED
 
Fields inherited from interface org.cougaar.core.blackboard.BlackboardClient
current
 
Constructor Summary
ProcessOrderPlugin()
           
 
Method Summary
protected  void execute()
          Process the subscriptions: match topping PG on Order Tasks with the PGs on the KitchenAsset, and if the Kitchen has the needed PGs, respond with SUCCESS.
 void load()
          Set up our services and our factory.
 void setDomainService(org.cougaar.core.service.DomainService aDomainService)
          Used by the binding utility through introspection to set my DomainService Services that are required for plugin usage should be set through reflection instead of explicitly getting each service from your ServiceBroker in the load method.
protected  void setupSubscriptions()
          Create the subscriptions to my Order Tasks, PlanElements for those, and Kitchen Asset
 
Methods inherited from class org.cougaar.core.plugin.ComponentPlugin
getConfigFinder
 
Methods inherited from class org.cougaar.core.blackboard.BlackboardClientComponent
currentTimeMillis, cycle, getAgentIdentifier, getAlarmService, getBindingSite, getBlackboardClientName, getBlackboardService, getMessageAddress, getParameter, getParameters, getServiceBroker, halt, precycle, requestCycle, resume, setAgentIdentificationService, setAlarmService, setBindingSite, setBlackboardService, setParameter, setSchedulerService, setServiceBroker, setSuicideService, shouldExecute, start, stop, suspend, toString, unload, wasAwakened
 
Methods inherited from class org.cougaar.util.GenericStateModelAdapter
getModelState, initialize, transitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.cougaar.util.GenericStateModel
getModelState, halt, initialize, resume, start, stop, suspend, unload
 

Constructor Detail

ProcessOrderPlugin

public ProcessOrderPlugin()
Method Detail

setDomainService

public void setDomainService(org.cougaar.core.service.DomainService aDomainService)
Used by the binding utility through introspection to set my DomainService Services that are required for plugin usage should be set through reflection instead of explicitly getting each service from your ServiceBroker in the load method. The setter methods are called after the component is constructed but before the state methods such as initialize, load, setupSubscriptions, etc. If the service is not available at that time the component will be unloaded.


load

public void load()
Set up our services and our factory.


setupSubscriptions

protected void setupSubscriptions()
Create the subscriptions to my Order Tasks, PlanElements for those, and Kitchen Asset


execute

protected void execute()
Process the subscriptions: match topping PG on Order Tasks with the PGs on the KitchenAsset, and if the Kitchen has the needed PGs, respond with SUCCESS.