toolbox.services
Class ServiceRegistryFactory

Package class diagram package ServiceRegistryFactory
java.lang.Object
  extended by toolbox.services.ServiceRegistryFactory

public final class ServiceRegistryFactory
extends java.lang.Object

Static factory to create and manage ServiceRegistry instances. The factory uses the following mechanism to find the name of the ServiceRegistry implementation:

The factory requires a properties file containing the names and configuration locations of all the registries supported. The location of the properties file is specified using the system property toolbox.services.ServiceRegistryFactory.config. The properties file must be in the format "<name>=<path>".


Method Summary
static void destroyRegistry(java.lang.String name)
          Remove and destroy the named registry.
static ServiceRegistry getRegistry(java.lang.String name)
          Return the named ServiceRegistry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRegistry

public static ServiceRegistry getRegistry(java.lang.String name)
                                   throws ServiceException
Return the named ServiceRegistry.

Parameters:
name - The name of the registry to create.
Returns:
ServiceRegistry instance.
Throws:
ServiceException - if the registry cannot be returned.

destroyRegistry

public static void destroyRegistry(java.lang.String name)
                            throws ServiceException
Remove and destroy the named registry.

Parameters:
name - String containing the name of the registry to destroy.
Throws:
ServiceException - if the registry cannot be destroyed.