Package org.apache.avalon.fortress

Examples of org.apache.avalon.fortress.ContainerManager


     * @exception java.lang.Exception if an error occurs
     */
    public static final void main( String[] args )
        throws Exception
    {
        ContainerManager cm = null;

        try
        {
            final FortressConfig config = new FortressConfig();
            config.setContainerClass( ComponentViewer.class );
            config.setContainerConfiguration( "resource://org/apache/avalon/fortress/examples/viewer/ComponentViewer.xconf" );
            config.setLoggerManagerConfiguration( "resource://org/apache/avalon/fortress/examples/viewer/ComponentViewer.xlog" );

            // needs the altrmi binaries
      //   config.setInstrumentManagerConfiguration( "resource://org/apache/avalon/fortress/examples/viewer/ComponentViewer.instruments" );

            cm = new DefaultContainerManager( config.getContext() );
            org.apache.avalon.framework.container.ContainerUtil.initialize( cm );

            ( (ComponentViewer)cm.getContainer() ).run();
        }
        catch( CascadingException e )
        {
            e.printStackTrace();

View Full Code Here


        config.setContainerClass( ExtendedContainer.class );
        config.setContainerConfiguration( "resource://org/apache/avalon/fortress/examples/extended/ExtendedContainer.xconf" );
        config.setLoggerManagerConfiguration( "resource://org/apache/avalon/fortress/examples/extended/ExtendedContainer.xlog" );
        setupExtensions(config);

        final ContainerManager cm = new DefaultContainerManager( config.getContext() );
        ContainerUtil.initialize( cm );

        m_container = (ExtendedContainer)cm.getContainer();

        m_container.doLookups();

        ContainerUtil.dispose( cm );
    }
View Full Code Here

        // need the altrmi binaries

  //   config.setInstrumentManagerConfiguration( "resource://org/apache/avalon/fortress/examples/swing/SwingContainer.instruments" );

        // Get the root container initialized
        ContainerManager cm = new DefaultContainerManager( config.getContext() );
        ContainerUtil.initialize( cm );

        /* Special containers such as Swing applications run in a different
         * thread in the background.  This is only one method of handling
         * a Swing based container.  Another alternative is to have the root
         * JFrame/JWindow/JDialog at this level, and hand a reference of the
         * container or its ServiceManager to the Swing class.  That will allow
         * you to defer proper shutdown of Fortress resources when your
         * application is closed.
         */
        ( (SwingContainer)cm.getContainer() ).run();

        // Properly clean up when we are done
        ContainerUtil.dispose( cm );
    }
View Full Code Here

        config.setWorkDirectory( "./" );
        final String BASE = "resource://org/apache/avalon/fortress/test/data/";
        config.setContainerConfiguration( BASE + "test1.xconf" );
        config.setLoggerManagerConfiguration( BASE + "test1.xlog" );

        final ContainerManager cm = new DefaultContainerManager( config.getContext() );
        ContainerUtil.initialize( cm );

        final DefaultContainer container = (DefaultContainer) cm.getContainer();
        final ServiceManager serviceManager = container.getServiceManager();
        return serviceManager;
    }
View Full Code Here

        config.setContainerConfiguration( containerConfig );
        config.setLoggerManagerConfiguration( loggerConfig );
        config.setInstrumentManagerConfiguration( instrumentConfig );

        // Get the root container initialized
        ContainerManager cm = new DefaultContainerManager( config.getContext() );
        ContainerUtil.initialize( cm );

        /* Special containers such as Swing applications run in a different
         * thread in the background.  This is only one method of handling
         * a Swing based container.  Another alternative is to have the root
         * JFrame/JWindow/JDialog at this level, and hand a reference of the
         * container or its ServiceManager to the Swing class.  That will allow
         * you to defer proper shutdown of Fortress resources when your
         * application is closed.
         */
        ( (SwingContainer)cm.getContainer() ).run();

        // Properly clean up when we are done
        ContainerUtil.dispose( cm );
    }
View Full Code Here

        config.setContainerClass( ExtendedContainer.class );
        config.setContainerConfiguration( "resource://org/apache/avalon/fortress/examples/extended/ExtendedContainer.xconf" );
        config.setLoggerManagerConfiguration( "resource://org/apache/avalon/fortress/examples/extended/ExtendedContainer.xlog" );
        setupExtensions(config);

        final ContainerManager cm = new DefaultContainerManager( config.getContext() );
        ContainerUtil.initialize( cm );

        m_container = (ExtendedContainer)cm.getContainer();

        m_container.doLookups();

        ContainerUtil.dispose( cm );
    }
View Full Code Here

     * @exception java.lang.Exception if an error occurs
     */
    public static final void main( String[] args )
        throws Exception
    {
        ContainerManager cm = null;

        try
        {
            final FortressConfig config = new FortressConfig();
            config.setContainerClass( ComponentViewer.class );
            config.setContainerConfiguration( "resource://org/apache/avalon/fortress/examples/viewer/ComponentViewer.xconf" );
            config.setLoggerManagerConfiguration( "resource://org/apache/avalon/fortress/examples/viewer/ComponentViewer.xlog" );
            config.setInstrumentManagerConfiguration( "resource://org/apache/avalon/fortress/examples/viewer/ComponentViewer.instruments" );

            cm = new DefaultContainerManager( config.getContext() );
            org.apache.avalon.framework.container.ContainerUtil.initialize( cm );

            ( (ComponentViewer)cm.getContainer() ).run();
        }
        catch( CascadingException e )
        {
            e.printStackTrace();

View Full Code Here

        config.setWorkDirectory( "./" );
        final String BASE = "resource://org/apache/avalon/fortress/test/data/";
        config.setContainerConfiguration( BASE + "test1.xconf" );
        config.setLoggerManagerConfiguration( BASE + "test1.xlog" );

        final ContainerManager cm = new DefaultContainerManager( config.getContext() );
        ContainerUtil.initialize( cm );

        final DefaultContainer container = (DefaultContainer) cm.getContainer();
        final ServiceManager serviceManager = container.getServiceManager();
        return serviceManager;
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.fortress.ContainerManager

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.