org.iids.aos.util
Class LookupCache

java.lang.Object
  extended by org.iids.aos.util.LookupCache

public class LookupCache
extends java.lang.Object

Class LookupCache Class to cache references to System Services, such as Location Managers, Host Managers, and Message Centers. Addresses of these System Services are looked up in the LookupServer and a connection is made to this System Service via a Communicator. Recently established connections are kept in cache.


Field Summary
static boolean ALLOW_LOCAL_CONNECTIONS
           
 
Method Summary
static LookupCache createPrivateLookupCache(AsLookupService lookupService, Communicator comm)
           
protected  void finalize()
           
 AgentServer getAgentServer(Address address)
           
 HostManager getHostManager(Address address)
           
 HostManager getHostManager(AgentHandle handle)
          Get a reference to the host manager hosting a specific agent.
 HostManager getHostManager(AgentID id)
           
 Address getHostManagerAddress(AgentID id)
           
 LocationManager getLocationManager(Address address)
           
 LocationManager getLocationManager(AgentScapeID location)
           
static LookupCache getLookupCache()
           
static LookupCache getLookupCache(AsLookupService lookupService, Communicator comm)
           
 HostManager getMessageCenter(Address a)
           
 HostManager getMessageCenter(AgentID id)
           
 Address getMessageCenterAddress(AgentID id)
           
 AgentID handleToAgentID(AgentHandle handle)
          Get AgentID belonging to an AgentHandle.
 void releaseSystemService(SystemService s)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_LOCAL_CONNECTIONS

public static boolean ALLOW_LOCAL_CONNECTIONS
Method Detail

getLookupCache

public static LookupCache getLookupCache(AsLookupService lookupService,
                                         Communicator comm)

createPrivateLookupCache

public static LookupCache createPrivateLookupCache(AsLookupService lookupService,
                                                   Communicator comm)

getLookupCache

public static LookupCache getLookupCache()

shutdown

public void shutdown()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getHostManagerAddress

public Address getHostManagerAddress(AgentID id)
                              throws AgentIDUnknownException
Throws:
AgentIDUnknownException

getHostManager

public HostManager getHostManager(AgentID id)
                           throws AgentIDUnknownException
Throws:
AgentIDUnknownException

getHostManager

public HostManager getHostManager(AgentHandle handle)
                           throws AgentUnknownException
Get a reference to the host manager hosting a specific agent.

Parameters:
handle - A handle belonging to the agent.
Returns:
Reference to the host manager hosting the agent.
Throws:
AgentUnknownException

handleToAgentID

public AgentID handleToAgentID(AgentHandle handle)
                        throws AgentUnknownException
Get AgentID belonging to an AgentHandle. Queries the lookup service (cache) to find the AgentID belonging to a handle.

Parameters:
handle - The AgentHandle to resolve.
Returns:
The AgentID belonging to this handle.
Throws:
AgentUnknownException - If the AgentHandle could not be resolved.

getHostManager

public HostManager getHostManager(Address address)

getLocationManager

public LocationManager getLocationManager(AgentScapeID location)
                                   throws LocationUnknownException
Throws:
LocationUnknownException

getLocationManager

public LocationManager getLocationManager(Address address)

getMessageCenter

public HostManager getMessageCenter(AgentID id)
                             throws AgentIDUnknownException
Throws:
AgentIDUnknownException

getMessageCenter

public HostManager getMessageCenter(Address a)

getMessageCenterAddress

public Address getMessageCenterAddress(AgentID id)
                                throws AgentIDUnknownException
Throws:
AgentIDUnknownException

getAgentServer

public AgentServer getAgentServer(Address address)

releaseSystemService

public void releaseSystemService(SystemService s)


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.