Package jade.wrapper
Interface PlatformController
-
- All Known Implementing Classes:
AgentContainer
public interface PlatformControllerDefines those methods which are permitted on a platform.
NOT available in MIDP- Author:
- David Bell, Dick Cowan: Hewlett-Packard
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePlatformController.ListenerInner callback interface to receive platform events.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPlatformListener(PlatformController.Listener aListener)Add a platform listener.AgentControllercreateNewAgent(String nickName, String className, Object[] args)Create a new agent.AgentControllergetAgent(String localAgentName)Get agent proxy to local agent given its name.StringgetName()Get the name of the platform.StategetState()Returns an instance of PlatformState.voidkill()Kill the agent platform.voidremovePlatformListener(PlatformController.Listener aListener)Remove a platform listener.voidresume()Activate the agent platform.voidstart()Start the platform after its been initialized.voidsuspend()Suspend the agent platform.
-
-
-
Method Detail
-
getName
String getName()
Get the name of the platform.- Returns:
- String The platform name.
-
start
void start() throws ControllerExceptionStart the platform after its been initialized.- Throws:
ControllerException- If any probelms other than illegal state occur.IllegalStateException- If state is illegal for this activity.
-
suspend
void suspend() throws ControllerExceptionSuspend the agent platform. Next action may be resume or kill.- Throws:
ControllerException- If any probelms other than illegal state occur.IllegalStateException- If state is illegal for this activity.
-
resume
void resume() throws ControllerExceptionActivate the agent platform. Next action may be suspend or kill.- Throws:
ControllerException- If any probelms other than illegal state occur.IllegalStateException- If state is illegal for this activity.
-
kill
void kill() throws ControllerException
Kill the agent platform. Kills all agents.- Throws:
ControllerException- If any probelms other than illegal state occur.IllegalStateException- If state is illegal for this activity.
-
getAgent
AgentController getAgent(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
AgentController createNewAgent(String nickName, String className, 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:
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
State getState()
Returns an instance of PlatformState.
-
addPlatformListener
void addPlatformListener(PlatformController.Listener aListener) throws ControllerException
Add a platform listener.- Parameters:
aListener- The listener to be notified.- Throws:
ControllerException
-
removePlatformListener
void removePlatformListener(PlatformController.Listener aListener) throws ControllerException
Remove a platform listener.- Parameters:
aListener- The listener to be notified.- Throws:
ControllerException
-
-