Class EscapeAgent

java.lang.Object
  |
  +--org.objectweb.mobilitools.smi.goodies.BasicMobileObject
        |
        +--EscapeAgent
All Implemented Interfaces:
MobileObject, java.io.Serializable

public class EscapeAgent
extends BasicMobileObject

MobiliTools $Name: $, $Id: EscapeAgent.java,v 1.1.1.1 2003/03/28 14:47:58 dillense Exp $

This agent example class shows how an agent may escape from an agency before it shuts down.
The easiest way to try this example is to run at least 2 GUI-enabled agencies, to create at least one EscapeAgent instance in one of the agencies, and to shut it down.

NB: THIS EXAMPLE REQUIRES THE MAFFINDER TO BE RUNNING BEFORE LAUNCHING AGENCIES AND AGENTS.

See Also:
Serialized Form

Field Summary
(package private)  Name my_name
           
 
Fields inherited from class org.objectweb.mobilitools.smi.goodies.BasicMobileObject
my_agency
 
Constructor Summary
EscapeAgent()
           
 
Method Summary
 void afterBirth(AgentSystem agency, AgentInfo entry, java.lang.Object argument)
           
 void beforeDeath()
           
 void beforeShutdown()
          Get the list of agencies in current region, and escape to the first one in the list (if any).
 
Methods inherited from class org.objectweb.mobilitools.smi.goodies.BasicMobileObject
afterMove, afterMoveFailed, beforeMove, beforeResume, beforeSuspend
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

my_name

Name my_name
Constructor Detail

EscapeAgent

public EscapeAgent()
Method Detail

afterBirth

public void afterBirth(AgentSystem agency,
                       AgentInfo entry,
                       java.lang.Object argument)
                throws BadOperation
Overrides:
afterBirth in class BasicMobileObject

beforeShutdown

public void beforeShutdown()
Get the list of agencies in current region, and escape to the first one in the list (if any).
Overrides:
beforeShutdown in class BasicMobileObject

beforeDeath

public void beforeDeath()
Overrides:
beforeDeath in class BasicMobileObject