org.apache.qpid.server.registry
Class ApplicationRegistry
java.lang.Object
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.
Constructor Summary |
protected |
ApplicationRegistry(org.apache.commons.configuration.Configuration configuration)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_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
ApplicationRegistry
protected ApplicationRegistry(org.apache.commons.configuration.Configuration configuration)
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)