Package org.apache.avalon.framework.service

Examples of org.apache.avalon.framework.service.DefaultServiceManager


                    (ComponentHandler) metaEntry.getHandlerClass().newInstance();

            // do the handler lifecycle
            ContainerUtil.enableLogging( targetHandler, getLogger() );
            ContainerUtil.contextualize( targetHandler, m_context );
            final DefaultServiceManager serviceManager =
                    new DefaultServiceManager( getServiceManager() );
            serviceManager.put( ObjectFactory.ROLE, factory );
            serviceManager.makeReadOnly();

            ContainerUtil.service( targetHandler, serviceManager );
            ContainerUtil.configure( targetHandler, configuration );
            ContainerUtil.initialize( targetHandler );
View Full Code Here


     *
     * @throws Exception when there is an error.
     */
    protected void initializeDefaultSourceResolver() throws Exception
    {
        final DefaultServiceManager manager = new DefaultServiceManager();
        final DefaultServiceSelector selector = new DefaultServiceSelector();
        final URLSourceFactory file = new URLSourceFactory();
        file.enableLogging( getLogger() );
        selector.put( "*", file );
        final ResourceSourceFactory resource = new ResourceSourceFactory();
        resource.enableLogging( getLogger() );
        selector.put( "resource", resource );

        manager.put( ResourceSourceFactory.ROLE + "Selector", selector );

        final SourceResolverImpl resolver = new SourceResolverImpl();
        ContainerUtil.enableLogging( resolver, getLogger() );
        ContainerUtil.contextualize( resolver, m_childContext );
        ContainerUtil.service( resolver, manager );
View Full Code Here

     * @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.ROLE, m_sink );
        manager.put( MetaInfoManager.ROLE, m_metaInfoManager );
        manager.put( PoolManager.ROLE, m_poolManager );
        manager.put( InstrumentManager.ROLE, m_instrumentManager );
        manager.put( ThreadManager.ROLE, m_threadManager );

        if ( lem != null )
        {
            manager.put( LifecycleExtensionManager.ROLE, lem );
        }

        manager.makeReadOnly();

        m_containerManagerContext.put( SERVICE_MANAGER, manager );
        m_childContext.put( SERVICE_MANAGER, manager );
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.service.DefaultServiceManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.