electric.registry.compound
Class CompoundRegistry

java.lang.Object
  extended byelectric.registry.compound.CompoundRegistry
All Implemented Interfaces:
IRegistry

public class CompoundRegistry
extends java.lang.Object
implements IRegistry

CompoundRegistry aggregates a collection of IRegistry objects.

Author:
webMethods

Constructor Summary
CompoundRegistry()
           
 
Method Summary
 IRegistryListener addListener(java.lang.String name, IRegistryListener listener)
          Add the specified listener to the collection of listeners.
 void addRegistry(java.lang.String name, IRegistry registry)
          Add the specified registry to the collection of registries with the default priority of 5.
 void addRegistry(java.lang.String name, IRegistry registry, float priority)
          Add the specified registry to the collection of registries.
 IReference bind(java.lang.String path, java.lang.Class[] interfaces, Context context)
          Return a reference to the service described by the path, interfaces, and context.
 IRegistryListener getListener(java.lang.String name)
          Return the specified listener from the collection of listeners, or null if not found.
 IRegistry getRegistry(java.lang.String name)
          Return the specified registry from the collection of registries, or null if not found.
 boolean publish(java.lang.String path, java.lang.Object object, Context context)
          Publish the object to the specified path.
 IRegistryListener removeListener(java.lang.String name)
          Remove and return the specified listener from the collection of listeners, or do nothing if not found.
 IRegistry removeRegistry(java.lang.String name)
          Remove and return the specified registry from the collection of registries, or do nothing if not found.
 boolean unpublish(java.lang.String path)
          Unpublish the object from the specified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundRegistry

public CompoundRegistry()
Method Detail

addRegistry

public void addRegistry(java.lang.String name,
                        IRegistry registry)
Add the specified registry to the collection of registries with the default priority of 5.

Parameters:
name - The name of the registry.
registry - The registry to add.

addRegistry

public void addRegistry(java.lang.String name,
                        IRegistry registry,
                        float priority)
Add the specified registry to the collection of registries.

Parameters:
name - The name of the registry.
registry - The registry to add.
priority - The priority, 1=highest, tried first

getRegistry

public IRegistry getRegistry(java.lang.String name)
Return the specified registry from the collection of registries, or null if not found.

Parameters:
name - The name of the registry.

removeRegistry

public IRegistry removeRegistry(java.lang.String name)
Remove and return the specified registry from the collection of registries, or do nothing if not found.

Parameters:
name - The name of the registry.

addListener

public IRegistryListener addListener(java.lang.String name,
                                     IRegistryListener listener)
Add the specified listener to the collection of listeners.

Parameters:
name - The name of the listener.
listener - The listener to add.

getListener

public IRegistryListener getListener(java.lang.String name)
Return the specified listener from the collection of listeners, or null if not found.

Parameters:
name - The name of the listener.

removeListener

public IRegistryListener removeListener(java.lang.String name)
Remove and return the specified listener from the collection of listeners, or do nothing if not found.

Parameters:
name - The name of the listener.

bind

public IReference bind(java.lang.String path,
                       java.lang.Class[] interfaces,
                       Context context)
                throws RegistryException
Return a reference to the service described by the path, interfaces, and context. Iterate through the registries, attempting to bind to each one in turn, and return the reference from the first success. If they all fail, return null.

Specified by:
bind in interface IRegistry
Parameters:
path - The path.
interfaces - The interfaces
context - The context.
Returns:
A reference to the service.
Throws:
RegistryException

publish

public boolean publish(java.lang.String path,
                       java.lang.Object object,
                       Context context)
                throws RegistryException
Publish the object to the specified path. Iterate through the registries, attempting to publish to each one in turn, and return true when the first one succeeds. If they all fail, return false.

Specified by:
publish in interface IRegistry
Parameters:
path - The path.
object - The object.
context - The context.
Returns:
True if the object was published.
Throws:
RegistryException

unpublish

public boolean unpublish(java.lang.String path)
                  throws RegistryException
Unpublish the object from the specified path. Iterate through the registries, attempting to unpublish from each one in turn, and return true when the first one succeeds. If they all fail, return false.

Specified by:
unpublish in interface IRegistry
Parameters:
path - The path.
Returns:
True if the object was unpublished.
Throws:
RegistryException


copyright© 2001-2004 by webMethods All Rights Reserved.