NextApp Echo
App Container 1.0.5

nextapp.echoservlet
Class ServiceRegistry

java.lang.Object
  extended bynextapp.echoservlet.ServiceRegistry
All Implemented Interfaces:
java.io.Serializable

class ServiceRegistry
extends java.lang.Object
implements java.io.Serializable

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


Field Summary
private  java.util.Map serviceAliases
          Maps a service to a set of aliases
private  java.util.Map serviceMap
          Maps service Ids to services
 
Constructor Summary
(package private) ServiceRegistry()
          Creates a new ServiceRegistry.
 
Method Summary
(package private)  void add(Service service)
          Adds a service to the registry.
(package private)  void add(Service service, java.lang.String alias)
          Adds an aliased service to the registry.
(package private)  Service get(Id id)
          Returns the service with the specified Id.
(package private)  void remove(Service service)
          Removes a service from the registry.
(package private)  void remove(Service service, java.lang.String alias)
          Removes an aliased service from the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceMap

private final java.util.Map serviceMap
Maps service Ids to services


serviceAliases

private final java.util.Map serviceAliases
Maps a service to a set of aliases

Constructor Detail

ServiceRegistry

ServiceRegistry()
Creates a new ServiceRegistry.

Method Detail

add

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

Parameters:
service - The service to be added.

add

void add(Service service,
         java.lang.String alias)
Adds an aliased service to the registry. Aliased service are only removed when all of their aliases have been removed. This enables ancillary services to be used by multiple components.

Parameters:
service - The service to be added.
alias - The alias to use for the service.

get

Service get(Id 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

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

Parameters:
service - The service to be removed.

remove

void remove(Service service,
            java.lang.String alias)
Removes an aliased service from the registry. Aliased service are only removed when all of their aliases have been removed. This enables ancillary services to be used by multiple components.

Parameters:
service - The service to be removed.
alias - The alias of the service.

NextApp Echo
App Container 1.0.5