marketplace
Class FacilitatorAgent

java.lang.Object
  |
  +--ciagent.CIAgent
        |
        +--marketplace.FacilitatorAgent

public class FacilitatorAgent
extends CIAgent

The FacilitatorAgent class implements the global facilitator for the marketplace application.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable allAgents
           
protected  java.util.Hashtable communities
           
protected  BuySellMessage msg
           
protected  java.util.Random random
           
 
Fields inherited from class ciagent.CIAgent
agentPlatform, children, DEFAULT_ASYNCTIME, DEFAULT_SLEEPTIME, name, parent, traceLevel
 
Constructor Summary
protected FacilitatorAgent()
          Creates a FacilitatorAgent object.
protected FacilitatorAgent(java.lang.String name)
          Creates a FacilitatorAgent object.
 
Method Summary
static FacilitatorAgent getInstance()
          In the Singleton design pattern, used to get single instance.
 java.lang.String getTaskDescription()
          Retrieves the task description (null).
 void initialize()
          Initializes the agent by setting the sleep time to 10 seconds.
 void process()
          Does nothing.
 void processCIAgentEvent(CIAgentEvent e)
          Processes a CIAgentEvent.
 void processTimerPop()
          Processes a timer pop by putting out a trace message.
static void register(CIAgentEvent e)
          Registers the agent contains in the given event.
 void reset()
          Clears the agent and communities hashtables.
 void route(BuySellMessage msg)
          Routes a message to the proper agent.
 
Methods inherited from class ciagent.CIAgent
addAgent, addCIAgentEventListener, addPropertyChangeListener, getAgent, getAgentPlatform, getAgents, getAsyncTime, getChildren, getCustomizerClass, getDisplayName, getName, getParent, getSleepTime, getState, getTraceLevel, notifyCIAgentEventListeners, postCIAgentEvent, processAsynchronousEvents, removeAgent, removeCIAgentEventListener, removePropertyChangeListener, resumeAgentProcessing, setAgentPlatform, setAsyncTime, setName, setParent, setSleepTime, setState, setTraceLevel, startAgentProcessing, stopAgentProcessing, suspendAgentProcessing, trace
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

protected java.util.Random random

allAgents

protected java.util.Hashtable allAgents

communities

protected java.util.Hashtable communities

msg

protected BuySellMessage msg
Constructor Detail

FacilitatorAgent

protected FacilitatorAgent()
Creates a FacilitatorAgent object. Note: can't be used as a Java Bean without public constructor

FacilitatorAgent

protected FacilitatorAgent(java.lang.String name)
Creates a FacilitatorAgent object.
Parameters:
name - the String object that contains the name of the facilitator
Method Detail

initialize

public void initialize()
Initializes the agent by setting the sleep time to 10 seconds.
Overrides:
initialize in class CIAgent

reset

public void reset()
Clears the agent and communities hashtables.
Overrides:
reset in class CIAgent

getTaskDescription

public java.lang.String getTaskDescription()
Retrieves the task description (null).
Returns:
the String object (null)
Overrides:
getTaskDescription in class CIAgent

process

public void process()
Does nothing.
Overrides:
process in class CIAgent

processTimerPop

public void processTimerPop()
Processes a timer pop by putting out a trace message.
Overrides:
processTimerPop in class CIAgent

processCIAgentEvent

public void processCIAgentEvent(CIAgentEvent e)
Processes a CIAgentEvent.
Parameters:
e - the CIAgentEvent object to be processed
Overrides:
processCIAgentEvent in class CIAgent

getInstance

public static FacilitatorAgent getInstance()
In the Singleton design pattern, used to get single instance.
Returns:
the FacilitatorAgent object

register

public static void register(CIAgentEvent e)
Registers the agent contains in the given event.
Parameters:
e - the CIAgentEvent object that contains the agent to be registered

route

public void route(BuySellMessage msg)
Routes a message to the proper agent.
Parameters:
msg - the BuySellMessage object that contains the message to be routed