NextApp Echo3
v3.0.b4

nextapp.echo.webcontainer
Class ServiceRegistry

java.lang.Object
  extended by nextapp.echo.webcontainer.ServiceRegistry

public class ServiceRegistry
extends java.lang.Object

A registry of Service objects that may be recalled based on Id values.


Constructor Summary
ServiceRegistry()
          Creates a new ServiceRegistry.
 
Method Summary
 void add(Service service)
          Adds a service to the registry.
 Service get(java.lang.String id)
          Returns the service with the specified Id.
 void remove(Service service)
          Removes a service from the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceRegistry

public ServiceRegistry()
Creates a new ServiceRegistry.

Method Detail

add

public void add(Service service)
Adds a service to the registry.

By default, this will throw an IllegalArgumentException if an attempt to register two different service objects under the same service id is made.

However, there may be times when it is desirable to simply ignore these extra requests and return without throwing an exception, such as when a JVM-level shared memory cache is in operation within a cluster. In this situation, the service registry may have already been populated by another node member, and when the application is first invoked an another node member, attempts will be made to populate the registry again. In this situation, we just ignore the superfluous requests.

In order to turn off the duplicate service id exception for this scenario, specify the system property nextapp.echo.webcontainer.ServiceRegistry.disableDuplicateServiceCheck with a value of true.

Parameters:
service - The service to be added.

get

public Service get(java.lang.String id)
Returns the service with the specified Id.

Parameters:
id - The Id of the service to be retrieved.
Returns:
The service which is identified by id.

remove

public void remove(Service service)
Removes a service from the registry.

Parameters:
service - The service to be removed.

NextApp Echo3
v3.0.b4