* @throws Exception when there is an error.
*/
protected void initializeServiceManager() throws Exception
{
final ServiceManager parent = (ServiceManager) get( m_rootContext, SERVICE_MANAGER, null );
final DefaultServiceManager manager = new EAServiceManager( parent, getLogger().getChildLogger("compat") );
/**
* If there is a parent ServiceManager, we need to see if it has a SourceResolver,
* and if not, make sure that one is available to fortress
*/
if ( parent == null || !parent.hasService( SourceResolver.ROLE ) )
{
manager.put( SourceResolver.ROLE, m_defaultSourceResolver );
}
Object lem = get( m_rootContext, LifecycleExtensionManager.ROLE, null);
/**
* Role manager won't be passed here as it is now only
* an utility for reading ECM role files.
*/
manager.put( LoggerManager.ROLE, m_loggerManager );
manager.put( Sink.class.getName(), m_sink );
manager.put( MetaInfoManager.ROLE, m_metaInfoManager );
manager.put( PoolManager.class.getName(), m_poolManager );
manager.put( InstrumentManager.ROLE, m_instrumentManager );
manager.put( ThreadManager.class.getName(), m_threadManager );
if ( lem != null )
{
manager.put( LifecycleExtensionManager.ROLE, lem );
}
manager.makeReadOnly();
m_containerManagerContext.put( SERVICE_MANAGER, manager );
m_childContext.put( SERVICE_MANAGER, manager );
}