com.cometway.ak
Class AgentController

java.lang.Object
  extended by com.cometway.props.Props
      extended by com.cometway.ak.AgentController
All Implemented Interfaces:
AgentControllerInterface

public class AgentController
extends Props
implements AgentControllerInterface

An implementation of AgentControllerInterface that is created by AgentKernel to control the agents it creates.


Constructor Summary
AgentController(AgentInterface agent)
          Constructor for this class.
 
Method Summary
 void destroy()
          Starts the controlled Agent and puts it into the DESTROYED_STATE.
 Props getProps()
          Returns the Props for the controlled agent.
 void start()
          Starts the controlled Agent and puts it into the RUNNING_STATE.
 void stop()
          Starts the controlled Agent and puts it into the STOPPED_STATE.
 java.lang.String toString()
          Returns the controlled agent's toString output (ie: 100_ServiceManager).
 
Methods inherited from class com.cometway.props.Props
addListener, append, copy, copyFrom, copyTo, decrementInteger, dump, enableListeners, enumerateKeys, format, getBoolean, getByteArray, getCharacter, getDate, getDate, getDateString, getDouble, getFloat, getHexString, getInteger, getKeys, getLong, getNextKey, getProperty, getProperty, getPropsContainer, getSize, getString, getString, getTokens, getTokens, getTrimmedString, getVector, hasProperty, incrementInteger, insertProps, loadProps, notifyPropsChanged, notifyPropsChangedIgnore, notifyPropsChangedIgnore, parse, propertyMatchesRegEx, readFromFile, regExPropertyMatches, removeAll, removeListener, removeProperty, resumeNotify, saveProps, set, setBoolean, setCharacter, setDefault, setDouble, setFloat, setInteger, setLong, setProperty, setProperty, setProperty, setPropsContainer, suspendNotify, writeToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentController

public AgentController(AgentInterface agent)
Constructor for this class.

Parameters:
agent - an AgentInterface instance to be controlled
Method Detail

toString

public java.lang.String toString()
Returns the controlled agent's toString output (ie: 100_ServiceManager).

Overrides:
toString in class Props

getProps

public Props getProps()
Returns the Props for the controlled agent.

Specified by:
getProps in interface AgentControllerInterface

start

public void start()
Starts the controlled Agent and puts it into the RUNNING_STATE. This method will throw an AgentStateException if the agent's current state is not the STOPPED_STATE.

Specified by:
start in interface AgentControllerInterface

stop

public void stop()
Starts the controlled Agent and puts it into the STOPPED_STATE. This method will throw an AgentStateException of the agent's current state is not RUNNING_STATE.

Specified by:
stop in interface AgentControllerInterface

destroy

public void destroy()
Starts the controlled Agent and puts it into the DESTROYED_STATE. This method will throw an AgentStateException of the agent's current state is not STOPPED_STATE.

Specified by:
destroy in interface AgentControllerInterface