jade.wrapper
Interface PlatformController

All Known Implementing Classes:
AgentContainer

public interface PlatformController

Defines those methods which are permitted on a platform.

Author:
David Bell, Dick Cowan: Hewlett-Packard

Inner Class Summary
static interface PlatformController.Listener
           
 
Method Summary
 void addPlatformListener(PlatformController.Listener aListener)
          Add a platform listener.
 AgentController createNewAgent(java.lang.String nickname, java.lang.String className, java.lang.Object[] args)
          Create a new agent.
 AgentController getAgent(java.lang.String localAgentName)
          Get agent proxy to local agent given its name.
 java.lang.String getName()
          Get the name of the platform.
 State getState()
          Returns an instance of PlatformState.
 void kill()
          Kill the agent platform.
 void removePlatformListener(PlatformController.Listener aListener)
          Remove a platform listener.
 void resume()
          Activate the agent platform.
 void start()
          Start the platform after its been initialized.
 void suspend()
          Suspend the agent platform.
 

Method Detail

getName

public java.lang.String getName()
Get the name of the platform.
Returns:
String The platform name.

start

public void start()
           throws ControllerException
Start the platform after its been initialized.
Throws:
ControllerException - If any probelms other than illegal state occur.
java.lang.IllegalStateException - If state is illegal for this activity.

suspend

public void suspend()
             throws ControllerException
Suspend the agent platform. Next action may be resume or kill.
Throws:
ControllerException - If any probelms other than illegal state occur.
java.lang.IllegalStateException - If state is illegal for this activity.

resume

public void resume()
            throws ControllerException
Activate the agent platform. Next action may be suspend or kill.
Throws:
ControllerException - If any probelms other than illegal state occur.
java.lang.IllegalStateException - If state is illegal for this activity.

kill

public void kill()
          throws ControllerException
Kill the agent platform. Kills all agents.
Throws:
ControllerException - If any probelms other than illegal state occur.
java.lang.IllegalStateException - If state is illegal for this activity.

getAgent

public AgentController getAgent(java.lang.String localAgentName)
                         throws ControllerException
Get agent proxy to local agent given its name.
Parameters:
localAgentName - The short local name of the desired agent.
Throws:
ControllerException - If any probelms occur obtaining this proxy.

createNewAgent

public AgentController createNewAgent(java.lang.String nickname,
                                      java.lang.String className,
                                      java.lang.Object[] args)
                               throws ControllerException
Create a new agent.
Parameters:
nickName - The name of the agent.
className - The class implementing the agent.
args - The agents parameters - typically String[] from a configuration file.
Returns:
AgentController to enable control of the agent.
Throws:
java.lang.IllegalStateException - If state is illegal for this activity.
ControllerException - If any else goes wrong. All other exceptions are caught and rethrown as a ControllerException.

getState

public State getState()
Returns an instance of PlatformState.

addPlatformListener

public void addPlatformListener(PlatformController.Listener aListener)
                         throws ControllerException
Add a platform listener.
Parameters:
aListener - The listener to be notified.

removePlatformListener

public void removePlatformListener(PlatformController.Listener aListener)
                            throws ControllerException
Remove a platform listener.
Parameters:
aListener - The listener to be notified.