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

public abstract class ApplicationRegistry
extends 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
protected  Map<InetSocketAddress,QpidAcceptor> _acceptors
           
protected  AuthenticationManager _authenticationManager
           
protected  UUID _brokerId
           
protected  ServerConfiguration _configuration
           
protected  ConfigurationManager _configurationManager
           
protected  PrincipalDatabaseManager _databaseManager
           
protected static org.apache.log4j.Logger _logger
           
protected  ManagedObjectRegistry _managedObjectRegistry
           
protected  PluginManager _pluginManager
           
protected  QMFService _qmfService
           
protected  String _registryName
           
protected  RootMessageLogger _rootMessageLogger
           
protected  SecurityManager _securityManager
           
protected  CompositeStartupMessageLogger _startupMessageLogger
           
protected  VirtualHostRegistry _virtualHostRegistry
           
static int DEFAULT_INSTANCE
           
 
Constructor Summary
protected ApplicationRegistry(ServerConfiguration configuration)
           
 
Method Summary
 void addAcceptor(InetSocketAddress bindAddress, QpidAcceptor acceptor)
          Register any acceptors for this registry
 void close()
          Shutdown this Registry
 void configure()
           
protected  void createDatabaseManager(ServerConfiguration configuration)
           
 VirtualHost createVirtualHost(VirtualHostConfiguration vhostConfig)
           
 AuthenticationManager getAuthenticationManager()
           
 BrokerConfig getBroker()
           
 UUID getBrokerId()
           
 RootMessageLogger getCompositeStartupMessageLogger()
           
 ConfigStore getConfigStore()
           
 ServerConfiguration getConfiguration()
          Get the low level configuration.
 ConfigurationManager getConfigurationManager()
           
 PrincipalDatabaseManager getDatabaseManager()
           
static IApplicationRegistry getInstance()
           
static IApplicationRegistry getInstance(int instanceID)
           
 ManagedObjectRegistry getManagedObjectRegistry()
           
 PluginManager getPluginManager()
           
 QMFService getQMFService()
           
 RootMessageLogger getRootMessageLogger()
           
 SecurityManager getSecurityManager()
           
 VirtualHostRegistry getVirtualHostRegistry()
           
static void initialise(IApplicationRegistry instance)
           
static void initialise(IApplicationRegistry instance, int instanceID)
           
 void initialise(int instanceID)
          Initialise the application registry.
protected  void initialiseManagedObjectRegistry()
           
protected  void initialiseVirtualHosts()
           
static boolean isConfigured()
           
static boolean isConfigured(int instanceID)
           
static void remove()
          Method to cleanly shutdown the default registry running in this JVM
static void remove(int instanceID)
          Method to cleanly shutdown specified registry running in this JVM
static void removeAll()
          Method to cleanly shutdown all registries currently running in this JVM
 void setBroker(BrokerConfig broker)
           
 void setConfigStore(ConfigStore configStore)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected static final org.apache.log4j.Logger _logger

_configuration

protected final ServerConfiguration _configuration

DEFAULT_INSTANCE

public static final int DEFAULT_INSTANCE
See Also:
Constant Field Values

_acceptors

protected final Map<InetSocketAddress,QpidAcceptor> _acceptors

_managedObjectRegistry

protected ManagedObjectRegistry _managedObjectRegistry

_authenticationManager

protected AuthenticationManager _authenticationManager

_virtualHostRegistry

protected VirtualHostRegistry _virtualHostRegistry

_securityManager

protected SecurityManager _securityManager

_databaseManager

protected PrincipalDatabaseManager _databaseManager

_pluginManager

protected PluginManager _pluginManager

_configurationManager

protected ConfigurationManager _configurationManager

_rootMessageLogger

protected RootMessageLogger _rootMessageLogger

_startupMessageLogger

protected CompositeStartupMessageLogger _startupMessageLogger

_brokerId

protected UUID _brokerId

_qmfService

protected QMFService _qmfService

_registryName

protected String _registryName
Constructor Detail

ApplicationRegistry

protected ApplicationRegistry(ServerConfiguration configuration)
Method Detail

initialise

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

initialise

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

getConfigStore

public ConfigStore getConfigStore()
Specified by:
getConfigStore in interface IApplicationRegistry

setConfigStore

public void setConfigStore(ConfigStore configStore)
Specified by:
setConfigStore in interface IApplicationRegistry

isConfigured

public static boolean isConfigured()

isConfigured

public static boolean isConfigured(int instanceID)

remove

public static void remove()
Method to cleanly shutdown the default registry running in this JVM


remove

public static void remove(int instanceID)
Method to cleanly shutdown specified registry running in this JVM

Parameters:
instanceID - the instance to shutdown

removeAll

public static void removeAll()
Method to cleanly shutdown all registries currently running in this JVM


configure

public void configure()
               throws ConfigurationException
Throws:
ConfigurationException

initialise

public void initialise(int instanceID)
                throws Exception
Description copied from interface: IApplicationRegistry
Initialise the application registry. All initialisation must be done in this method so that any components that need access to the application registry itself for initialisation are able to use it. Attempting to initialise in the constructor will lead to failures since the registry reference will not have been set.

Specified by:
initialise in interface IApplicationRegistry
Parameters:
instanceID - the instanceID that we can use to identify this AR.
Throws:
Exception

createDatabaseManager

protected void createDatabaseManager(ServerConfiguration configuration)
                              throws Exception
Throws:
Exception

initialiseVirtualHosts

protected void initialiseVirtualHosts()
                               throws Exception
Throws:
Exception

initialiseManagedObjectRegistry

protected void initialiseManagedObjectRegistry()
                                        throws org.apache.qpid.AMQException
Throws:
org.apache.qpid.AMQException

getInstance

public static IApplicationRegistry getInstance()

getInstance

public static IApplicationRegistry getInstance(int instanceID)

close

public void close()
Description copied from interface: IApplicationRegistry
Shutdown this Registry

Specified by:
close in interface IApplicationRegistry

getConfiguration

public ServerConfiguration 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

addAcceptor

public void addAcceptor(InetSocketAddress bindAddress,
                        QpidAcceptor acceptor)
Description copied from interface: IApplicationRegistry
Register any acceptors for this registry

Specified by:
addAcceptor in interface IApplicationRegistry
Parameters:
bindAddress - The address that the acceptor has been bound with
acceptor - The acceptor in use

getVirtualHostRegistry

public VirtualHostRegistry getVirtualHostRegistry()
Specified by:
getVirtualHostRegistry in interface IApplicationRegistry

getSecurityManager

public SecurityManager getSecurityManager()
Specified by:
getSecurityManager in interface IApplicationRegistry

getManagedObjectRegistry

public ManagedObjectRegistry getManagedObjectRegistry()
Specified by:
getManagedObjectRegistry in interface IApplicationRegistry

getDatabaseManager

public PrincipalDatabaseManager getDatabaseManager()
Specified by:
getDatabaseManager in interface IApplicationRegistry

getAuthenticationManager

public AuthenticationManager getAuthenticationManager()
Specified by:
getAuthenticationManager in interface IApplicationRegistry

getPluginManager

public PluginManager getPluginManager()
Specified by:
getPluginManager in interface IApplicationRegistry

getConfigurationManager

public ConfigurationManager getConfigurationManager()
Specified by:
getConfigurationManager in interface IApplicationRegistry

getRootMessageLogger

public RootMessageLogger getRootMessageLogger()
Specified by:
getRootMessageLogger in interface IApplicationRegistry

getCompositeStartupMessageLogger

public RootMessageLogger getCompositeStartupMessageLogger()

getBrokerId

public UUID getBrokerId()
Specified by:
getBrokerId in interface IApplicationRegistry

getQMFService

public QMFService getQMFService()
Specified by:
getQMFService in interface IApplicationRegistry

getBroker

public BrokerConfig getBroker()
Specified by:
getBroker in interface IApplicationRegistry

setBroker

public void setBroker(BrokerConfig broker)
Specified by:
setBroker in interface IApplicationRegistry

createVirtualHost

public VirtualHost createVirtualHost(VirtualHostConfiguration vhostConfig)
                              throws Exception
Specified by:
createVirtualHost in interface IApplicationRegistry
Throws:
Exception


Licensed to the Apache Software Foundation