Examples of ContainerManager


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

Examples of org.apache.avalon.fortress.ContainerManager

        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

Examples of org.apache.avalon.fortress.ContainerManager

        // 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

Examples of org.apache.avalon.fortress.ContainerManager

        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

Examples of org.apache.avalon.fortress.ContainerManager

        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

Examples of org.apache.avalon.fortress.ContainerManager

        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

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" );
            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

Examples of org.apache.avalon.fortress.ContainerManager

        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

Examples of org.apache.hadoop.yarn.api.ContainerManager

      // the user in createRemoteUser in this context has to be ContainerID
      user = UserGroupInformation.createRemoteUser(containerID.toString());
      user.addToken(token);
    }

    ContainerManager proxy = user.doAs(new PrivilegedAction<ContainerManager>() {
      @Override
      public ContainerManager run() {
        return (ContainerManager) yarnRPC.getProxy(ContainerManager.class,
            cmAddr, conf);
      }
View Full Code Here

Examples of org.apache.hadoop.yarn.api.ContainerManager

      state = ContainerState.DONE;
      LOG.error("Container (" + containerID + " was killed before it was launched");
      return;
    }

    ContainerManager proxy = null;
    try {

      proxy = getCMProxy(containerID, containerMgrAddress,
          containerToken);

      // Construct the actual Container
      ContainerLaunchContext containerLaunchContext = createContainerLaunchContext(commonContainerLaunchContext);

      // Now launch the actual container
      StartContainerRequest startRequest = Records
          .newRecord(StartContainerRequest.class);
      startRequest.setContainerLaunchContext(containerLaunchContext);
      StartContainerResponse response = proxy.startContainer(startRequest);

      ByteBuffer portInfo = response
          .getServiceResponse(PullServerAuxService.PULLSERVER_SERVICEID);

      if(portInfo != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.