|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjade.core.Agent
jade.wrapper.gateway.GatewayAgent
public class 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 Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jade.core.Agent |
|---|
Agent.Interrupted |
| Field Summary |
|---|
| Fields inherited from class jade.core.Agent |
|---|
AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN, MSG_QUEUE_CLASS |
| 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. |
protected void |
takeDown()
This protected method is an empty placeholder for application specific cleanup code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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()
AgentBehaviour object to the agent, in order for it to be
able to do anything.
setup in class AgentAgent.addBehaviour(Behaviour b),
Behaviourprotected void takeDown()
Agent
takeDown in class Agent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||