lime
Class LimeAgentMgr

java.lang.Object
  extended bylime.LimeAgentMgr
All Implemented Interfaces:
java.io.Serializable

public class LimeAgentMgr
extends java.lang.Object
implements java.io.Serializable

This is returned when loading an agent into the LimeServer.

Version:
8/22/2002
Author:
Amy L. Murphy, Gian Pietro Picco, Chien-Liang Fok
See Also:
Serialized Form

Field Summary
private  AgentID id
          The AgentID for the agent this object manages.
private static long maxID
          A static integer used to create a unique AgentID.
(package private)  java.util.Vector spaces
          Holds the tuple spaces currently owned by the agent this object manages.
private  java.util.Vector spacesShared
          Holds the tuple spaces that was shared by the agent this object manages.
 
Constructor Summary
LimeAgentMgr()
          Creates the manager for a Lime Agent.
 
Method Summary
 void disengage()
          Disengages the agent by unsharing all shared tuple spaces.
 void engage()
          Engages the agent by sharing all tuple spaces that were shared when disengage was called.
 AgentID getID()
          Returns the AgentID of the agent that this manager manages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxID

private static long maxID
A static integer used to create a unique AgentID.


id

private AgentID id
The AgentID for the agent this object manages.


spaces

java.util.Vector spaces
Holds the tuple spaces currently owned by the agent this object manages. Useful for mobility.


spacesShared

private java.util.Vector spacesShared
Holds the tuple spaces that was shared by the agent this object manages. It is used in the disengage() method to "remember" which tuple spaces were shared prior to disengagement.

Constructor Detail

LimeAgentMgr

public LimeAgentMgr()
Creates the manager for a Lime Agent. It creates a unique AgentID for the LimeAgent.

Method Detail

getID

public AgentID getID()
Returns the AgentID of the agent that this manager manages.

Returns:
the AgentID of the agent that this manager manages.

disengage

public void disengage()
Disengages the agent by unsharing all shared tuple spaces. If no tuple spaces are shared (e.g. the agent is already disengaged, then calling this method has no affect.


engage

public void engage()
Engages the agent by sharing all tuple spaces that were shared when disengage was called. If all of the tuple spaces are already shared, this method does not do anything.