|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jade.wrapper.Agent
This class is a Proxy class, allowing access to a JADE agent.
Invoking methods on instances of this class, it is possible to
trigger state transition of the agent life cycle. This class must
not be instantiated by applications. Instead, use the
createAgent()
method in class
AgentContainer
.
throws NotFoundException, StaleProxyException
Field Summary | |
static boolean |
ASYNC
Constant representing an asynchronous rendez-vous policy. |
static boolean |
SYNC
Constant representing a synchronous rendez-vous policy. |
Constructor Summary | |
Agent(AID id,
Agent a)
Default constructor. |
Method Summary | |
void |
activate()
Triggers a state transition from SUSPENDED to ACTIVE. |
void |
clone(Location where,
java.lang.String newName)
Clones the current agent. |
java.lang.String |
getName()
Get the platforms name of the agent. |
State |
getState()
Read current agent state. |
void |
kill()
Triggers a state transition from ACTIVE to DELETED. |
void |
move(Location where)
Triggers a state transition from ACTIVE to TRANSIT. |
void |
putO2AObject(java.lang.Object o,
boolean blocking)
Passes an application-specific object to a local agent, created using JADE In-Process Interface. |
void |
start()
Triggers a state transition from INITIATED to ACTIVE. |
void |
suspend()
Triggers a state transition from ACTIVE to SUSPENDED. |
protected void |
validateProxy()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final boolean ASYNC
putO2AObject(Object o, boolean blocking)
public static final boolean SYNC
putO2AObject(Object o, boolean blocking)
Constructor Detail |
public Agent(AID id, Agent a)
AgentContainer.createAgent()
should
be used instead.a
- A real JADE agent, that will be wrapped by this proxy.throws NotFoundException, StaleProxyException
Method Detail |
protected void validateProxy() throws StaleProxyException
public java.lang.String getName() throws StaleProxyException
public void start() throws StaleProxyException
public void suspend() throws StaleProxyException
public void activate() throws StaleProxyException
public void kill() throws StaleProxyException
public void move(Location where) throws StaleProxyException
where
- A Location
object, representing the
container the agent should move to.public void clone(Location where, java.lang.String newName) throws StaleProxyException
where
- The Location
object, representing the
container where the new agent copy will start.newName
- The new nickname to give to the copy.public void putO2AObject(java.lang.Object o, boolean blocking) throws StaleProxyException
jade.core.Agent.getO2AObject()
method. The agent
must first declare its will to accept passed objects, using the
jade.core.Agent.setEnabledO2ACommunication()
method.o
- The object to put in the private agent queue.blocking
- A flag, stating the desired rendez-vous policy;
it can be ASYNC
, for a non-blocking call, returning
right after putting the object in the quque, or
SYNC
, for a blocking call that does not return until
the agent picks the object from the private queue.Agent.getO2AObject()
,
Agent.setEnabledO2ACommunication(boolean enabled, int queueSize)
public State getState() throws StaleProxyException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |