avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager DefaultManager.java MX4JSystemManager.java
Date Thu, 20 Jun 2002 11:08:01 GMT
colus       2002/06/20 04:08:01

  Modified:    src/java/org/apache/avalon/phoenix/components/embeddor
                        DefaultEmbeddor.java
               src/java/org/apache/avalon/phoenix/components/manager
                        DefaultManager.java MX4JSystemManager.java
  Log:
  Move component registeration to Embeddor.
  Need code cleanup.
  
  Revision  Changes    Path
  1.68      +19 -0     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/embeddor/DefaultEmbeddor.java
  
  Index: DefaultEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/embeddor/DefaultEmbeddor.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- DefaultEmbeddor.java	20 May 2002 11:48:36 -0000	1.67
  +++ DefaultEmbeddor.java	20 Jun 2002 11:08:01 -0000	1.68
  @@ -36,6 +36,7 @@
   import org.apache.avalon.phoenix.interfaces.Embeddor;
   import org.apache.avalon.phoenix.interfaces.EmbeddorMBean;
   import org.apache.avalon.phoenix.interfaces.Kernel;
  +import org.apache.avalon.phoenix.interfaces.SystemManager;
   
   /**
    * This is the object that is interacted with to create, manage and
  @@ -196,6 +197,17 @@
           {
               createComponents();
               setupComponents();
  +            final SystemManager systemManager = (SystemManager)getServiceManager().lookup(
SystemManager.ROLE );
  +            systemManager.register( ManagementInfo.EMBEDDOR.getName(), this, ManagementInfo.EMBEDDOR.getInterfaces()
);
  +            for( int i = 0; i < m_entrys.length; i++ )
  +            {
  +                System.out.println( m_entrys[ i ].getRole() );
  +                final ManagementInfo mi = ManagementInfo.getManagementInfoForRole( m_entrys[
i ].getRole() );
  +                if ( null != mi )
  +                {
  +                    systemManager.register( mi.getName(), m_entrys[ i ].getObject(), mi.getInterfaces()
);
  +                }
  +            }
           }
           catch( final Exception e )
           {
  @@ -291,6 +303,13 @@
           try
           {
               shutdownComponents();
  +            final SystemManager systemManager = (SystemManager)getServiceManager().lookup(
SystemManager.ROLE );
  +            systemManager.unregister( ManagementInfo.EMBEDDOR.getName() );
  +            for( int i = 0; i < m_entrys.length; i++ )
  +            {
  +                final ManagementInfo mi = ManagementInfo.getManagementInfoForRole( m_entrys[
i ].getRole() );
  +                systemManager.unregister( mi.getName() );
  +            }
           }
           catch( final Exception e )
           {
  
  
  
  1.24      +0 -11     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/DefaultManager.java
  
  Index: DefaultManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/DefaultManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DefaultManager.java	19 Jun 2002 12:24:00 -0000	1.23
  +++ DefaultManager.java	20 Jun 2002 11:08:01 -0000	1.24
  @@ -149,17 +149,6 @@
               e.printStackTrace();
               throw e;
           }
  -
  -        //TODO: SystemManager itself aswell???
  -        //FIXME: All this stuff should be done by embeddor and read out of a config file
  -        register( "Kernel", m_kernel, new Class[]{KernelMBean.class} );
  -        register( "ExtensionManager",
  -                  m_extensionManager,
  -                  new Class[]{ExtensionManagerMBean.class} );
  -        register( "Embeddor", m_embeddor, new Class[]{EmbeddorMBean.class} );
  -        register( "Deployer", m_deployer, new Class[]{DeployerMBean.class} );
  -        register( "LogManager", m_logManager );
  -        register( "ConfigurationRepository", m_repository );
       }
   
       public void start()
  
  
  
  1.7       +1 -18     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java
  
  Index: MX4JSystemManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MX4JSystemManager.java	20 May 2002 11:57:31 -0000	1.6
  +++ MX4JSystemManager.java	20 Jun 2002 11:08:01 -0000	1.7
  @@ -44,7 +44,7 @@
    */
   public class MX4JSystemManager
       extends AbstractSystemManager
  -    implements Parameterizable, Serviceable
  +    implements Serviceable
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( MX4JSystemManager.class );
  @@ -61,12 +61,6 @@
       private ConfigurationRepository m_repository;
       private PackageRepository m_extensionManager;
   
  -    public void parameterize( final Parameters parameters )
  -        throws ParameterException
  -    {
  -        // m_parameters = parameters;
  -    }
  -
       /**
        * Retrieve relevant services needed to deploy.
        *
  @@ -129,17 +123,6 @@
   
           // starts the server
           m_mBeanServer.invoke( adaptorName, "start", null, null );
  -
  -        //TODO: SystemManager itself aswell???
  -        //FIXME: All this stuff should be done by embeddor and read out of a config file
  -        register( "Kernel", m_kernel, new Class[]{KernelMBean.class} );
  -        register( "ExtensionManager",
  -                  m_extensionManager,
  -                  new Class[]{ExtensionManagerMBean.class} );
  -        register( "Embeddor", m_embeddor, new Class[]{EmbeddorMBean.class} );
  -        register( "Deployer", m_deployer, new Class[]{DeployerMBean.class} );
  -        register( "LogManager", m_logManager );
  -        register( "ConfigurationRepository", m_repository );
       }
   
       public void start()
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message