springs.util
Class ReferenceServer

java.lang.Object
  |
  +--springs.util.ReferenceServer
All Implemented Interfaces:
ConfigurationParameters, Debug

public class ReferenceServer
extends java.lang.Object
implements ConfigurationParameters

Utility class to search for references.

Author:
Sergio Ilarri Artigas

Field Summary
private static java.util.Hashtable _agentCache
          Contains RMI references to static objects.
 
Fields inherited from interface springs.common.ConfigurationParameters
_persistence, ACTIVATE_AUTOMATIC_REFERENCES_UPDATES, ACTIVATE_NAMING_SERVICE, AGENT_REFERENCES_UPDATER_NAME, BACKLOG, BLOCK_UNTIL_REFERENCE_UPDATED_IF_NEEDED, COLLECT_LOGS_CALLS, CONTEXT_MANAGER_NAME, CONTEXT_WATCHING_PERIOD, CRASH_WHEN_NOT_ENOUGH_MEMORY, CREATE_AGENTS_IN_BACKGROUND, DEFAULT_PORT_NUMBER_FOR_CONTEXTS, DELAY_DEPARTURES_IF_NEEDED, DISABLE_LOGGER, EXPORT_RETRIAL, FORCE_REMOVALS, HYBRID_STRATEGY_PROXY_UPDATE, INITIAL_SEPARATOR_URL, LAZY_UPDATE_AGENT_OBJECT, LEASE_VALUE, MAX_MILLIS_TO_WAIT_FOR_ARU, MAX_MILLIS_TO_WAIT_FOR_UPDATE_REFERENCE, MAX_TRIES_ASSIGNING_THREAD_TO_AGENT, MAXIMUM_NUMBER_OF_CONSECUTIVE_FAILED_PINGS, MILLIS_TO_KEEP_MARKED_TO_REMOVE_REFERENCES, MILLIS_TO_KEEP_UNUSED_LOCAL_REFERENCES, MILLIS_TO_WAIT_FOR_CLASS_SERVER_READY, MILLIS_TO_WAIT_FOR_RMI_REGISTRY_CREATION, MINIMUM_MILLIS_STAY_AT_CONTEXT, NUM_STAYS_TO_COMPUTE_AVERAGE_STAY, PERIOD_LARC, REBIND_RETRIAL, REGION_NAME_SERVER_NAME, RETRYING_STRATEGY_FOR_AGENT_SEARCHING, RETRYING_STRATEGY_FOR_CREATIONS, RETRYING_STRATEGY_FOR_INVOKATIONS, RETRYING_STRATEGY_FOR_REMOTE_REFERENCE_UPDATING, RETURN_CALL_RESULTS_WITH_STATISTICS, RMI_PROTOCOL, SECURITY_POLICY, TIME_BETWEEN_TRIES_ASSIGNING_THREAD_TO_AGENT, TIMEOUT_CONNECTION_RMI, TIMEOUT_RMI, TRACE_RMI_SERVERS, TRACKING_FACTOR, UPDATE_REFERENCES_IN_BACKGROUND, UPDATE_REFERENCES_WITH_AUXILIARY_THREAD, USE_CACHE_OF_CLASSES, USE_SOCKETS_COUNTING_BYTES, USE_SPECIFIC_SOCKET_FACTORY, WAIT_UNTIL_REFERENCES_UPDATED, WRITE_CONTEXT_LOGS_IN_STDOUT
 
Fields inherited from interface springs.common.Debug
DEBUG_ACCESS_SERVICE, DEBUG_BASIC, DEBUG_CLASS_LOADING, DEBUG_CONTEXT_MANAGER, DEBUG_CONTEXT_STATUS_WHEN_MEMORY_ERROR, DEBUG_CREATION, DEBUG_DELETING, DEBUG_NAMING_SERVICE, DEBUG_PROBLEMS_WITH_RMI_CLASS_LOADING, DEBUG_REFERENCE_UPDATER, DEBUG_REMOVAL, DEBUG_RMI, DEBUG_RMI_FAILURES, DEBUG_RNS, DEBUG_SEARCHING, DEBUG_SENDING, DEBUG_TIMES, LOG_CONTEXT_INFO, PRINT_EXCEPTION_FAILED_REMOTE_CALLS, PRINT_FAILED_MOVEMENTS, PRINT_FAILED_REMOTE_CALLS, PRINT_FAILED_REMOTE_REFERENCE_UPDATING, PRINT_FAILED_SEARCHINGS, PRINT_RETRYING_TASK_FAILURES, PROXY_QUEUE
 
Constructor Summary
ReferenceServer()
           
 
Method Summary
static java.lang.Object getAgent(springs.context.ContextAddress contextAddress, java.lang.String agentName)
          Obtains an agent at a certain address.
static java.lang.Object getAgent(springs.context.ContextAddress contextAddress, java.lang.String agentName, boolean useCache)
          Obtains an agent at a certain address.
static springs.context.ContextManager getContextManager(springs.context.ContextAddress contextAddress)
          Obtains the context manager at a certain address.
static springs.rns.RegionNameServerInterface getRegionNameServerInterface()
          Obtains an interface to the region name server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_agentCache

private static java.util.Hashtable _agentCache
Contains RMI references to static objects.

See Also:
Hashtable
Constructor Detail

ReferenceServer

public ReferenceServer()
Method Detail

getContextManager

public static springs.context.ContextManager getContextManager(springs.context.ContextAddress contextAddress)
                                                        throws CommunicationException
Obtains the context manager at a certain address.

Parameters:
contextAddress - the context address.
Returns:
the context manager.
Throws:
CommunicationException - if error.
See Also:
ContextAddress, ContextManager, CommunicationException

getAgent

public static java.lang.Object getAgent(springs.context.ContextAddress contextAddress,
                                        java.lang.String agentName,
                                        boolean useCache)
                                 throws CommunicationException
Obtains an agent at a certain address.

Parameters:
contextAddress - the context address.
agentName - the agent name.
useCache - a boolean indicating whether the cache of agents should be used.
Returns:
an object that somehow represents the agent.
Throws:
CommunicationException - if error.
See Also:
ContextAddress, String, ContextManager, CommunicationException

getAgent

public static java.lang.Object getAgent(springs.context.ContextAddress contextAddress,
                                        java.lang.String agentName)
                                 throws CommunicationException
Obtains an agent at a certain address.

Parameters:
contextAddress - the context address.
agentName - the agent name.
Returns:
an object that somehow represents the agent.
Throws:
CommunicationException - if error.
See Also:
ContextAddress, String, ContextManager, CommunicationException

getRegionNameServerInterface

public static springs.rns.RegionNameServerInterface getRegionNameServerInterface()
                                                                          throws CommunicationException
Obtains an interface to the region name server.

Returns:
an interface to the region name server.
Throws:
CommunicationException - if error.
See Also:
RegionNameServerInterface, CommunicationException