//Create the composite (log4j+SystemOut MessageLogger to be used during startup
RootMessageLogger[] messageLoggers = {new SystemOutMessageLogger(), _rootMessageLogger};
_startupMessageLogger = new CompositeStartupMessageLogger(messageLoggers);
BrokerActor actor = new BrokerActor(_startupMessageLogger);
CurrentActor.setDefault(actor);
CurrentActor.set(actor);
try
{
initialiseStatistics();
if(_configuration.getHTTPManagementEnabled())
{
_httpManagementPort = _configuration.getHTTPManagementPort();
}
if (_configuration.getHTTPSManagementEnabled())
{
_httpsManagementPort = _configuration.getHTTPSManagementPort();
}
_broker = new BrokerAdapter(this);
_configuration.initialise();
logStartupMessages(CurrentActor.get());
// Management needs to be registered so that JMXManagement.childAdded can create optional management objects
createAndStartManagementPlugins(_configuration, _broker);
_securityManager = new SecurityManager(_configuration.getConfig());
_groupManagerList = createGroupManagers(_configuration);
_authenticationManagerRegistry = createAuthenticationManagerRegistry(_configuration, new GroupPrincipalAccessor(_groupManagerList));
if(!_authManagerChangeListeners.isEmpty())
{
for(IAuthenticationManagerRegistry.RegistryChangeListener listener : _authManagerChangeListeners)
{
_authenticationManagerRegistry.addRegistryChangeListener(listener);
for(AuthenticationManager authMgr : _authenticationManagerRegistry.getAvailableAuthenticationManagers().values())
{
listener.authenticationManagerRegistered(authMgr);
}
}
_authManagerChangeListeners.clear();
}
}
finally
{
CurrentActor.remove();
}
CurrentActor.set(new BrokerActor(_rootMessageLogger));
try
{
initialiseVirtualHosts();
initialiseStatisticsReporting();
}