JBoss Remoting 3.0.0.Beta2

org.jboss.remoting.spi
Class NamedServiceRegistry

java.lang.Object
  extended by org.jboss.remoting.spi.NamedServiceRegistry

public final class NamedServiceRegistry
extends Object

A registry associating names with services. Specifically, the name is associated with a handle to a request handler source instance; this handle is owned by the registry, so closing the handle will remove the entry.


Constructor Summary
NamedServiceRegistry()
          Construct a new empty registry.
 
Method Summary
 Set<Map.Entry<QualifiedName,Handle<RequestHandlerSource>>> getEntrySet()
          Get an unmodifiable view of the entry set of the registry.
 Handle<RequestHandlerSource> lookupService(QualifiedName path)
          Find a service at a location in the registry.
 Handle<RequestHandlerSource> registerService(QualifiedName path, RequestHandlerSource service)
          Register a service at the given path.
 String toString()
          Returns a brief description of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedServiceRegistry

public NamedServiceRegistry()
Construct a new empty registry.

Method Detail

registerService

public Handle<RequestHandlerSource> registerService(QualifiedName path,
                                                    RequestHandlerSource service)
                                             throws IOException
Register a service at the given path. If the given service is closed, an exception will be thrown. Returns a handle to the service which may be used to unregister this service from the registry. In addition, if the service is closed, the registration will be automatically removed. To monitor the registration, add a close handler to the returned handle.

Parameters:
path - the path of the service registration
service - the service
Returns:
a handle which can be used to unregister the service
Throws:
IOException - if an error occurs

lookupService

public Handle<RequestHandlerSource> lookupService(QualifiedName path)
Find a service at a location in the registry.

Parameters:
path - the path
Returns:
a handle to the service, or null if it is not found

getEntrySet

public Set<Map.Entry<QualifiedName,Handle<RequestHandlerSource>>> getEntrySet()
Get an unmodifiable view of the entry set of the registry.

Returns:
a set view

toString

public String toString()
Returns a brief description of this object.

Overrides:
toString in class Object

JBoss Remoting 3.0.0.Beta2

Copyright © 2008 JBoss, a division of Red Hat, Inc.