|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jade.core.Agent | +--jade.wrapper.gateway.GatewayAgent
This agent is the gateway able to execute all commands requests received via JadeGateway.
JadeGateway
enables two alternative ways to implement a gateway
that allows non-JADE code to communicate with JADE agents.
The first one is to extend the GatewayAgent
The second one is to extend this GatewayBehaviour
and add an instance
of this Behaviour to your own agent that will have to function as a gateway (see its javadoc for reference).
JadeGateway
,
GatewayBehaviour
,
Serialized FormNested Class Summary |
Nested classes inherited from class jade.core.Agent |
Agent.Interrupted |
Constructor Summary | |
GatewayAgent()
|
Method Summary | |
protected void |
processCommand(java.lang.Object command)
subclasses may implement this method. |
void |
releaseCommand(java.lang.Object command)
notify that the command has been processed and remove the command from the queue |
protected void |
setup()
This protected method is an empty placeholder for application specific startup code. |
Methods inherited from class jade.core.Agent |
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, doActivate, doClone, doDelete, doMove, doSuspend, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, here, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, restore, restoreBufferedState, send, setEnabledO2ACommunication, setQueueSize, takeDown, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
run |
Constructor Detail |
public GatewayAgent()
Method Detail |
protected void processCommand(java.lang.Object command)
The recommended pattern is the following implementation:
if (c instanceof Command1)
exexCommand1(c);
else if (c instanceof Command2)
exexCommand2(c);
releaseCommand
.
onEnd()
method.
public final void releaseCommand(java.lang.Object command)
command
- is the same object that was passed in the processCommand methodprotected void setup()
Agent
Behaviour
object to the agent, in order for it to be
able to do anything.
setup
in class Agent
Agent.addBehaviour(Behaviour b)
,
Behaviour
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |