Package org.apache.avalon.framework.service

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


        throws Exception
    {
        final org.apache.avalon.fortress.util.test.FullLifecycleComponent component = new org.apache.avalon.fortress.util.test.FullLifecycleComponent();
        component.enableLogging( new NullLogger() );
        component.contextualize( new DefaultContext() );
        component.service( new DefaultServiceManager() );
        component.configure( new DefaultConfiguration( "", "" ) );

        try
        {
            component.parameterize( new Parameters() );
View Full Code Here


    public void testDoubleAssignOfConfiguration() throws Exception
    {
        final org.apache.avalon.fortress.util.test.FullLifecycleComponent component = new org.apache.avalon.fortress.util.test.FullLifecycleComponent();
        component.enableLogging( new NullLogger() );
        component.contextualize( new DefaultContext() );
        component.service( new DefaultServiceManager() );
        try
        {
            component.configure( new DefaultConfiguration( "", "" ) );
            component.configure( new DefaultConfiguration( "", "" ) );
        }
View Full Code Here

        final org.apache.avalon.fortress.util.test.FullLifecycleComponent component = new org.apache.avalon.fortress.util.test.FullLifecycleComponent();
        component.enableLogging( new NullLogger() );
        component.contextualize( new DefaultContext() );
        try
        {
            component.service( new DefaultServiceManager() );
            component.service( new DefaultServiceManager() );
        }
        catch ( Exception e )
        {
            // test successfull
            return;
View Full Code Here

    {
        FullLifecycleComponent component = new FullLifecycleComponent();

        component.enableLogging( new NullLogger() );
        component.contextualize( new DefaultContext() );
        component.service( new DefaultServiceManager() );
        component.configure( new DefaultConfiguration( "", "" ) );
        component.parameterize( new Parameters() );
        component.initialize();
        component.start();
        component.suspend();
View Full Code Here

    {
        FullLifecycleComponent component = new FullLifecycleComponent();

        component.enableLogging( new NullLogger() );
        component.contextualize( new DefaultContext() );
        component.service( new DefaultServiceManager() );
        component.configure( new DefaultConfiguration( "", "" ) );
        component.parameterize( new Parameters() );
        component.initialize();
        component.start();
        component.suspend();
View Full Code Here

    {
        FullLifecycleComponent component = new FullLifecycleComponent();

        component.enableLogging( new NullLogger() );
        component.contextualize( new DefaultContext() );
        component.service( new DefaultServiceManager() );
        component.configure( new DefaultConfiguration( "", "" ) );

        try
        {
            component.parameterize( new Parameters() );
View Full Code Here

    {
        FullLifecycleComponent component = new FullLifecycleComponent();

        component.enableLogging( new NullLogger() );
        component.contextualize( new DefaultContext() );
        component.service( new DefaultServiceManager() );

        try
        {
            component.configure( new DefaultConfiguration( "", "" ) );
            component.configure( new DefaultConfiguration( "", "" ) );
View Full Code Here

        m_config.setLoggerCategory( "test" );
        m_config.setLoggerManager( new DefaultLoggerManager() );
        m_config.setNumberOfThreadsPerCPU( 10 );
        m_config.setPoolManager( new DefaultPoolManager(commands) );
        m_config.setRoleManager( new FortressRoleManager() );
        m_config.setServiceManager( new DefaultServiceManager() );
        m_config.setThreadTimeout( 50 );
    }
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.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 );
    }
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.