org.apache.qpid.server.registry
Class ApplicationRegistry

java.lang.Object
  extended by org.apache.qpid.server.registry.ApplicationRegistry
All Implemented Interfaces:
IApplicationRegistry
Direct Known Subclasses:
ConfigurationFileApplicationRegistry, NullApplicationRegistry

public abstract class ApplicationRegistry
extends java.lang.Object
implements IApplicationRegistry

An abstract application registry that provides access to configuration information and handles the construction and caching of configurable objects.

Subclasses should handle the construction of the "registered objects" such as the exchange registry.


Field Summary
static java.lang.String _APPLICATION_REGISTRY
           
protected  org.apache.commons.configuration.Configuration _configuration
           
static java.lang.String DEFAULT_APPLICATION_REGISTRY
           
static int DEFAULT_INSTANCE
           
 
Constructor Summary
protected ApplicationRegistry(org.apache.commons.configuration.Configuration configuration)
           
 
Method Summary
 org.apache.commons.configuration.Configuration getConfiguration()
          Get the low level configuration.
<T> T
getConfiguredObject(java.lang.Class<T> instanceType)
          This gets access to a "configured object".
static IApplicationRegistry getInstance()
           
static IApplicationRegistry getInstance(int instanceID)
           
static void initialise(IApplicationRegistry instance)
           
static void initialise(IApplicationRegistry instance, int instanceID)
           
static void remove(int instanceID)
           
static void setDefaultApplicationRegistry(java.lang.String clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.qpid.server.registry.IApplicationRegistry
getAuthenticationManager, getExchangeFactory, getExchangeRegistry, getManagedObjectRegistry, getMessageStore, getQueueRegistry, initialise
 

Field Detail

_configuration

protected final org.apache.commons.configuration.Configuration _configuration

DEFAULT_INSTANCE

public static final int DEFAULT_INSTANCE
See Also:
Constant Field Values

DEFAULT_APPLICATION_REGISTRY

public static final java.lang.String DEFAULT_APPLICATION_REGISTRY
See Also:
Constant Field Values

_APPLICATION_REGISTRY

public static java.lang.String _APPLICATION_REGISTRY
Constructor Detail

ApplicationRegistry

protected ApplicationRegistry(org.apache.commons.configuration.Configuration configuration)
Method Detail

initialise

public static void initialise(IApplicationRegistry instance)
                       throws java.lang.Exception
Throws:
java.lang.Exception

initialise

public static void initialise(IApplicationRegistry instance,
                              int instanceID)
                       throws java.lang.Exception
Throws:
java.lang.Exception

remove

public static void remove(int instanceID)

getInstance

public static IApplicationRegistry getInstance()

getInstance

public static IApplicationRegistry getInstance(int instanceID)

getConfiguration

public org.apache.commons.configuration.Configuration getConfiguration()
Description copied from interface: IApplicationRegistry
Get the low level configuration. For use cases where the configured object approach is not required you can get the complete configuration information.

Specified by:
getConfiguration in interface IApplicationRegistry
Returns:
a Commons Configuration instance

getConfiguredObject

public <T> T getConfiguredObject(java.lang.Class<T> instanceType)
Description copied from interface: IApplicationRegistry
This gets access to a "configured object". A configured object has fields populated from a the configuration object (Commons Configuration) automatically, where it has the appropriate attributes defined on fields. Application registry implementations can choose the refresh strategy or caching approach.

Specified by:
getConfiguredObject in interface IApplicationRegistry
Parameters:
instanceType - the type of object you want initialised. This must be unique - i.e. you can only have a single object of this type in the system.
Returns:
the configured object

setDefaultApplicationRegistry

public static void setDefaultApplicationRegistry(java.lang.String clazz)