ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends CLIMain.java
Date Sat, 18 May 2002 23:36:32 GMT
donaldp     02/05/18 16:36:32

  Modified:    container/src/java/org/apache/myrmidon/components/deployer
                        DefaultDeployer.java
               container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               container/src/java/org/apache/myrmidon/components/library
                        DefaultLibraryManager.java
               container/src/java/org/apache/myrmidon/components/service
                        InstantiatingServiceManager.java
               container/src/java/org/apache/myrmidon/frontends
                        CLIMain.java
  Log:
  Integrate ContainerUtil into myrmidon.
  
  Revision  Changes    Path
  1.42      +9 -7      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/deployer/DefaultDeployer.java
  
  Index: DefaultDeployer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/deployer/DefaultDeployer.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- DefaultDeployer.java	9 May 2002 07:54:31 -0000	1.41
  +++ DefaultDeployer.java	18 May 2002 23:36:32 -0000	1.42
  @@ -14,6 +14,7 @@
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.myrmidon.interfaces.deployer.DefaultTypeDeployer;
   import org.apache.myrmidon.interfaces.deployer.Deployer;
   import org.apache.myrmidon.interfaces.deployer.DeploymentException;
  @@ -26,7 +27,7 @@
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.41 $ $Date: 2002/05/09 07:54:31 $
  + * @version $Revision: 1.42 $ $Date: 2002/05/18 23:36:32 $
    */
   public class DefaultDeployer
       extends AbstractLogEnabled
  @@ -50,9 +51,10 @@
       {
           // Assemble the type deployer
           final DefaultTypeDeployer defaultDeployer = new DefaultTypeDeployer();
  -        defaultDeployer.service( serviceManager );
  +        ContainerUtil.service( defaultDeployer, serviceManager );
  +
           final ConverterTypeDeployer converterDeployer = new ConverterTypeDeployer();
  -        converterDeployer.service( serviceManager );
  +        ContainerUtil.service( converterDeployer, serviceManager );
           m_typeDeployer = new CompoundTypeDeployer( defaultDeployer );
           m_typeDeployer.addDeployer( Converter.ROLE, converterDeployer );
   
  @@ -64,12 +66,12 @@
       /**
        * Creates a child deployer.
        */
  -    public Deployer createChildDeployer( final ServiceManager componentManager )
  +    public Deployer createChildDeployer( final ServiceManager serviceManager )
           throws ServiceException
       {
           final DefaultDeployer child = new DefaultDeployer();
  -        setupLogger( child );
  -        child.service( componentManager );
  +        ContainerUtil.enableLogging( child, getLogger() );
  +        ContainerUtil.service( child, serviceManager );
           return child;
       }
   
  @@ -88,7 +90,7 @@
                                                   m_typeDeployer,
                                                   namespace,
                                                   library.getClassLoader() );
  -            setupLogger( deployment );
  +            ContainerUtil.enableLogging( deployment, getLogger() );
               deployment.loadDescriptors( library.getClassPath() );
   
               return deployment;
  
  
  
  1.67      +7 -24     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java
  
  Index: DefaultEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- DefaultEmbeddor.java	18 May 2002 04:07:44 -0000	1.66
  +++ DefaultEmbeddor.java	18 May 2002 23:36:32 -0000	1.67
  @@ -20,15 +20,14 @@
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Startable;
  +import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.service.DefaultServiceManager;
   import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.service.Serviceable;
   import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.event.TaskListener;
  @@ -63,7 +62,7 @@
    * Instantiate this to embed inside other applications.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.66 $ $Date: 2002/05/18 04:07:44 $
  + * @version $Revision: 1.67 $ $Date: 2002/05/18 23:36:32 $
    */
   public class DefaultEmbeddor
       extends AbstractLogEnabled
  @@ -383,27 +382,11 @@
                                 final Parameters parameters )
           throws Exception
       {
  -        setupLogger( object );
  -
  -        if( object instanceof Contextualizable )
  -        {
  -            ( (Contextualizable)object ).contextualize( m_context );
  -
  -        }
  -        if( object instanceof Serviceable )
  -        {
  -            ( (Serviceable)object ).service( serviceManager );
  -        }
  -
  -        if( parameters != null && object instanceof Parameterizable )
  -        {
  -            ( (Parameterizable)object ).parameterize( parameters );
  -        }
  -
  -        if( object instanceof Initializable )
  -        {
  -            ( (Initializable)object ).initialize();
  -        }
  +        ContainerUtil.enableLogging( object, getLogger() );
  +        ContainerUtil.contextualize( object, m_context );
  +        ContainerUtil.service( object, serviceManager );
  +        ContainerUtil.parameterize( object, parameters );
  +        ContainerUtil.initialize( object );
       }
   
       /**
  
  
  
  1.7       +2 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java
  
  Index: DefaultLibraryManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultLibraryManager.java	15 May 2002 10:10:14 -0000	1.6
  +++ DefaultLibraryManager.java	18 May 2002 23:36:32 -0000	1.7
  @@ -39,10 +39,10 @@
    * The default library manager implementation.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.6 $ $Date: 2002/05/15 10:10:14 $
  + * @version $Revision: 1.7 $ $Date: 2002/05/18 23:36:32 $
    */
   public class DefaultLibraryManager
  -    implements Serviceable, Contextualizable, Initializable, LibraryManager
  +    implements LibraryManager, Contextualizable, Serviceable, Initializable
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultLibraryManager.class );
  
  
  
  1.7       +8 -28     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/service/InstantiatingServiceManager.java
  
  Index: InstantiatingServiceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/service/InstantiatingServiceManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- InstantiatingServiceManager.java	24 Apr 2002 02:21:00 -0000	1.6
  +++ InstantiatingServiceManager.java	18 May 2002 23:36:32 -0000	1.7
  @@ -15,7 +15,6 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.parameters.Parameterizable;
  @@ -26,6 +25,7 @@
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.myrmidon.interfaces.role.RoleInfo;
   import org.apache.myrmidon.interfaces.role.RoleManager;
   import org.apache.myrmidon.interfaces.service.ServiceFactory;
  @@ -49,7 +49,7 @@
    * </ul>
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.6 $ $Date: 2002/04/24 02:21:00 $
  + * @version $Revision: 1.7 $ $Date: 2002/05/18 23:36:32 $
    */
   public class InstantiatingServiceManager
       extends AbstractLogEnabled
  @@ -108,10 +108,7 @@
           for( Iterator iterator = m_objects.iterator(); iterator.hasNext(); )
           {
               final Object object = iterator.next();
  -            if( object instanceof Disposable )
  -            {
  -                ( (Disposable)object ).dispose();
  -            }
  +            ContainerUtil.shutdown( object );
           }
   
           // Ditch state
  @@ -221,28 +218,11 @@
       private void setupObject( final Object object )
           throws Exception
       {
  -        setupLogger( object );
  -
  -        if( m_context != null && object instanceof Contextualizable )
  -        {
  -            ( (Contextualizable)object ).contextualize( m_context );
  -        }
  -
  -        if( object instanceof Serviceable )
  -        {
  -            ( (Serviceable)object ).service( m_serviceManager );
  -        }
  -
  -        if( m_parameters != null && object instanceof Parameterizable )
  -        {
  -            ( (Parameterizable)object ).parameterize( m_parameters );
  -        }
  -
  -        if( object instanceof Initializable )
  -        {
  -            ( (Initializable)object ).initialize();
  -        }
  -
  +        ContainerUtil.enableLogging( object, getLogger() );
  +        ContainerUtil.contextualize( object, m_context );
  +        ContainerUtil.service( object, m_serviceManager );
  +        ContainerUtil.parameterize( object, m_parameters );
  +        ContainerUtil.initialize( object );
           m_objects.add( object );
       }
   }
  
  
  
  1.43      +5 -3      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/CLIMain.java
  
  Index: CLIMain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/CLIMain.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- CLIMain.java	10 May 2002 06:27:32 -0000	1.42
  +++ CLIMain.java	18 May 2002 23:36:32 -0000	1.43
  @@ -22,6 +22,7 @@
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.CascadingException;
   import org.apache.avalon.framework.ExceptionUtil;
  +import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.interfaces.executor.Executor;
  @@ -34,7 +35,7 @@
    * to run project.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.42 $ $Date: 2002/05/10 06:27:32 $
  + * @version $Revision: 1.43 $ $Date: 2002/05/18 23:36:32 $
    */
   public class CLIMain
   {
  @@ -330,8 +331,9 @@
               }
   
               // Setup logging
  -            final BasicLogger logger = new BasicLogger( "[myrmidon] ", m_priority );
  -            m_embedded.enableLogging( logger );
  +            final BasicLogger logger =
  +                new BasicLogger( "[myrmidon] ", m_priority );
  +            ContainerUtil.enableLogging( m_embedded, logger );
   
               if( m_dryRun )
               {
  
  
  

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


Mime
View raw message