public class ContainerController
extends java.lang.Object
createContainer()
method in class
Runtime
.
Runtime.createAgentContainer(Profile)
Modifier and Type | Field and Description |
---|---|
protected PlatformController |
myPlatformController |
Constructor and Description |
---|
ContainerController(ContainerProxy cp,
AgentContainer impl,
java.lang.String platformName)
This constructor requires a concrete
implementation of a JADE agent container, which cannot be
instantiated by applications, so it cannot be meaningfully called
from application code.
|
Modifier and Type | Method and Description |
---|---|
AgentController |
acceptNewAgent(java.lang.String nickname,
Agent anAgent)
Add an Agent to this container.
|
AgentController |
createNewAgent(java.lang.String nickname,
java.lang.String className,
java.lang.Object[] args)
Creates a new JADE agent, running within this container,
|
AgentController |
getAgent(java.lang.String localAgentName)
Get a controller (i.e. a proxy) to a local agent given its local-name.
|
AgentController |
getAgent(java.lang.String name,
boolean isGuid)
Get a controller (i.e. a proxy) to a local agent given its local-name or GUID.
|
java.lang.String |
getContainerName()
Retrieve the name of the wrapped container.
|
PlatformController |
getPlatformController()
Retrieve a controller for the platform the container
wrapped by this ContainerController belongs to and acts
as the Main Container.
|
java.lang.String |
getPlatformName()
Retrieve the name of the platform the container wrapped by this
ContainerController belongs to.
|
protected void |
initPlatformController() |
void |
installMTP(java.lang.String address,
java.lang.String className)
Installs a new message transport protocol, that will run within
this container.
|
boolean |
isJoined() |
void |
kill()
Shuts down this container, terminating all the agents running within it.
|
void |
uninstallMTP(java.lang.String address)
Removes a message transport protocol, previously running within this
container.
|
protected PlatformController myPlatformController
public ContainerController(ContainerProxy cp, AgentContainer impl, java.lang.String platformName)
Runtime.createContainer()
method.impl
- A concrete implementation of a JADE agent container.platformName
- the name of the platformRuntime.createAgentContainer(Profile)
public AgentController getAgent(java.lang.String localAgentName) throws ControllerException
localAgentName
- The local name of the desired agent.ControllerException
- If any problems occur obtaining this proxy or if no such agent exists in the local container.public AgentController getAgent(java.lang.String name, boolean isGuid) throws ControllerException
name
- The local name or the GUID of the desired agent.isGuid
- A flag indicating whether name
represents the local-name (AID.ISLOCALNAME
)
or the GUID (AID.ISGUID
) of the desired agent.ControllerException
- If any problems occur obtaining this proxy or if no such agent exists in the local container.public AgentController createNewAgent(java.lang.String nickname, java.lang.String className, java.lang.Object[] args) throws StaleProxyException
nickname
- A platform-unique nickname for the newly created
agent. The agent will be given a FIPA compliant agent identifier
using the nickname and the ID of the platform it is running on.className
- The fully qualified name of the class that
implements the agent.args
- An object array, containing initialization parameters
to pass to the new agent.StaleProxyException
public AgentController acceptNewAgent(java.lang.String nickname, Agent anAgent) throws StaleProxyException
nickname
- A platform-unique nickname for the newly created agent.
The agent will be given a FIPA compliant agent identifier using the nickname and
the ID of the platform it is running on.anAgent
- The agent to be added to this agent container.StaleProxyException
public void kill() throws StaleProxyException
StaleProxyException
public void installMTP(java.lang.String address, java.lang.String className) throws jade.mtp.MTPException, StaleProxyException
address
- The transport address exported by the new MTP, in
string format.className
- The fully qualified name of the Java class that
implements the transport protocol.jade.mtp.MTPException
- If something goes wrong during transport
protocol activation.StaleProxyException
public void uninstallMTP(java.lang.String address) throws jade.mtp.MTPException, NotFoundException, StaleProxyException
address
- The transport address exported by the new MTP, in
string format.jade.mtp.MTPException
- If something goes wrong during transport
protocol activation.NotFoundException
- If no protocol with the given
address is currently installed on this container.StaleProxyException
public java.lang.String getPlatformName()
public java.lang.String getContainerName() throws ControllerException
ControllerException
public PlatformController getPlatformController() throws ControllerException
PlatfromController
for the platform
the container wrapped by this ContainerController
belongs to.ControllerException
- If the container wrapped by this
ContainerController
is not valid or is not the
platform Main Container.protected void initPlatformController() throws ControllerException
ControllerException
public boolean isJoined()