|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jade.wrapper.gateway.JadeGateway
This class is the entry point for using the functionalities of a simple gateway useful to issue commands to a JADE Agent. The class is responsible for creating, and keeping alive, a JADE Container and a JADE Agent.
The package must be used as follows:
GatewayAgent
, that implements its method processCommand
and that is the agent responsible for processing all command-requests
init
with the
name of the class of the application-specific agent
JadeGateway.execute(Object command).
This method will cause the callback of
the method processCommand
of the application-specific agent.
The method execute
will return only after the method GatewayAgent.releaseCommand(command)
has been called
by your application-specific agent.
Method Summary | |
static void |
execute(java.lang.Object command)
execute a command. |
static void |
execute(java.lang.Object command,
long timeout)
execute a command specifying a timeout. |
static java.lang.String |
getProfileProperty(java.lang.String key,
java.lang.String defaultValue)
Searches for the property with the specified key in the JADE Platform Profile. |
static void |
init(java.lang.String agentClassName,
Properties jadeProfile)
Initialize this gateway by passing the proper configuration parameters |
static void |
shutdown()
Kill the JADE Container in case it is running. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final java.lang.String getProfileProperty(java.lang.String key, java.lang.String defaultValue)
key
- - the property key.defaultValue
- - a default value
Properties.getProperty(String, String)
public static final void execute(java.lang.Object command) throws StaleProxyException, ControllerException, java.lang.InterruptedException
releaseCommand
is called by the executor agent)
StaleProxyException
- if the method was not able to execute the Command
ControllerException
java.lang.InterruptedException
AgentController.putO2AObject(Object, boolean)
public static final void execute(java.lang.Object command, long timeout) throws StaleProxyException, ControllerException, java.lang.InterruptedException
releaseCommand
is called by the executor agent)
java.lang.InterruptedException
- if the timeout expires or the Thread
executing this method is interrupted.
StaleProxyException
- if the method was not able to execute the Command
ControllerException
AgentController.putO2AObject(Object, boolean)
public static final void init(java.lang.String agentClassName, Properties jadeProfile)
agentClassName
- is the fully-qualified class name of the agent to be executedjadeProfile
- the properties that contain all parameters for running JADE (see jade.core.Profile).
Typically these properties will have to be read from a JADE configuration file.
If jadeProfile is null, then a JADE container attaching to a main on the local host is launchedpublic static final void shutdown()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |