|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MobiliTools $Name: $, $Id: MobileObject.java,v 1.1.1.1 2003/03/28 14:48:06 dillense Exp $
This interface must be implemented by any agent class in order to be managed by the SMI framework.
Method Summary | |
void |
afterBirth(AgentSystem agency,
AgentInfo entry,
java.lang.Object arguments)
Called on agent creation. |
void |
afterMove(AgentSystem agency,
Location location,
java.lang.String place)
Called on reinstalling in the target agency after a move. |
void |
afterMoveFailed(Location agency,
java.lang.String place,
int reason,
java.lang.String message)
Called on move failure. (note that throwing an exception in beforeMove() does not result in
afterMoveFailed() being called) |
void |
beforeDeath()
Called before discarding the agent. (note that an exception in afterBirth() does not
result in beforeDeath() being called) |
void |
beforeMove(Location location,
java.lang.String place)
Called before before moving. |
void |
beforeResume()
Called to resume the agent activity (if any). |
void |
beforeShutdown()
Called before the agent's hosting agency shutdown. |
void |
beforeSuspend()
Called to suspend the agent activity (if any). |
Method Detail |
public void afterBirth(AgentSystem agency, AgentInfo entry, java.lang.Object arguments) throws BadOperation
agency
- reference to the hosting agency.entry
- a structure of information about the newly created agent.arguments
- arguments for agent initialization.BadOperation
- shall be thrown if the agent refuses to settle.
Identifier BadOperation.REJECTED must be set for this exception.
Note that the agent creation is canceled,
and that beforeDeath()
is not called.public void beforeMove(Location location, java.lang.String place) throws BadOperation
location
- location of destination agencyplace
- name of target placeBadOperation
- thrown to reject the move.
Identifier BadOperation.REJECTED must be set for this exception.
The agent move is simply canceled and the thrown exception is
re-thrown by moveAgent()
(note that afterMoveFailed()
is not called).public void afterMove(AgentSystem agency, Location location, java.lang.String place) throws BadOperation
agency
- reference to the new hosting agencylocation
- location of new hosting agencyplace
- the name of the new residing placeBadOperation
- thrown if the agent can not be
correctly reinstalled in the new agency.
Identifier BadOperation.REJECTED must be set for this exception.
The agent stays in the source agency, afterMoveFailed()
is invoked,
and moveAgent()
throws an exception.public void afterMoveFailed(Location agency, java.lang.String place, int reason, java.lang.String message)
beforeMove()
does not result in
afterMoveFailed()
being called)agency
- location of the target agencyplace
- the target place namereason
- problem identifiermessage
- textual explanationpublic void beforeDeath()
afterBirth()
does not
result in beforeDeath()
being called)public void beforeSuspend() throws BadOperation
BadOperation
- the agent activity was already suspended, or could not be suspended.
Identifier BadOperation.REJECTED must be set for this exception. SMI core detects
whether the agent is already suspended or not, and throws the corresponding exception if
necessary, without invoking this callback.public void beforeResume() throws BadOperation
BadOperation
- the agent activity was already running, or could not be resumed.
Identifier BadOperation.REJECTED must be set for this exception. SMI core detects
whether the agent is already running or not, and throws the corresponding exception if
necessary, without invoking this callback.public void beforeShutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |