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/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine DefaultTaskletEngine.java TaskletEngine.java
Date Mon, 28 May 2001 12:57:16 GMT
donaldp     01/05/28 05:57:15

  Modified:    proposal/myrmidon/src/java/org/apache/ant/modules/core
                        AbstractResourceRegisterer.java
                        RegisterConverter.java RegisterDataType.java
                        RegisterTasklet.java RegisterTasklib.java
               proposal/myrmidon/src/java/org/apache/ant/tasklet/engine
                        DefaultTaskletEngine.java TaskletEngine.java
  Log:
  Started to fix some of the more ugly hacks that violated IOC.
  
  Revision  Changes    Path
  1.4       +12 -2     jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/AbstractResourceRegisterer.java
  
  Index: AbstractResourceRegisterer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/AbstractResourceRegisterer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractResourceRegisterer.java	2001/05/28 07:36:43	1.3
  +++ AbstractResourceRegisterer.java	2001/05/28 12:57:12	1.4
  @@ -12,7 +12,9 @@
   import java.net.URL;
   import org.apache.ant.AntException;
   import org.apache.myrmidon.api.AbstractTask;
  +import org.apache.ant.tasklet.engine.TskDeployer;
   import org.apache.ant.tasklet.engine.TaskletEngine;
  +import org.apache.ant.tasklet.engine.DataTypeEngine;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.Composable;
  @@ -30,13 +32,21 @@
       protected String              m_lib;
       protected String              m_name;
       protected String              m_classname;
  -    protected TaskletEngine       m_engine;
  -    
  +    protected TskDeployer         m_tskDeployer;
  +    protected DataTypeEngine      m_dataTypeEngine;
  +    protected TaskletEngine          m_engine;
  +
       public void compose( final ComponentManager componentManager )
           throws ComponentException
       {
           m_engine = (TaskletEngine)componentManager.
               lookup( "org.apache.ant.tasklet.engine.TaskletEngine" );
  +
  +        m_tskDeployer = (TskDeployer)componentManager.
  +            lookup( "org.apache.ant.tasklet.engine.TskDeployer" );
  +
  +        m_dataTypeEngine = (DataTypeEngine)componentManager.
  +            lookup( "org.apache.ant.tasklet.engine.DataTypeEngine" );
       }
   
       public void setLib( final String lib )
  
  
  
  1.5       +12 -8     jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterConverter.java
  
  Index: RegisterConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegisterConverter.java	2001/05/28 07:36:43	1.4
  +++ RegisterConverter.java	2001/05/28 12:57:13	1.5
  @@ -14,7 +14,7 @@
   import org.apache.ant.convert.engine.ConverterEngine;
   import org.apache.ant.convert.engine.DefaultConverterInfo;
   import org.apache.myrmidon.api.AbstractTask;
  -import org.apache.ant.tasklet.engine.TaskletEngine;
  +import org.apache.ant.tasklet.engine.TskDeployer;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.Composable;
  @@ -35,13 +35,17 @@
       protected String              m_destinationType;
       protected String              m_lib;
       protected String              m_classname;
  -    protected TaskletEngine       m_engine;
  -    
  +    protected TskDeployer         m_tskDeployer;
  +    protected ConverterEngine     m_converterEngine;
  +
       public void compose( final ComponentManager componentManager )
           throws ComponentException
       {
  -        m_engine = (TaskletEngine)componentManager.
  -            lookup( "org.apache.ant.tasklet.engine.TaskletEngine" );
  +        m_tskDeployer = (TskDeployer)componentManager.
  +            lookup( "org.apache.ant.tasklet.engine.TskDeployer" );
  +
  +        m_converterEngine = (ConverterEngine)componentManager.
  +            lookup( "org.apache.ant.convert.engine.ConverterEngine" );
       }
   
       public void setLib( final String lib )
  @@ -95,7 +99,7 @@
           {
               try 
               { 
  -                m_engine.getTskDeployer().deployConverter( m_classname, url.toString(),
url ); 
  +                m_tskDeployer.deployConverter( m_classname, url.toString(), url ); 
               }
               catch( final DeploymentException de )
               {
  @@ -111,8 +115,8 @@
   
               try
               {
  -                m_engine.getConverterEngine().getInfoRegistry().register( m_classname,
info ); 
  -                m_engine.getConverterEngine().getRegistry().register( m_classname, locator
); 
  +                m_converterEngine.getInfoRegistry().register( m_classname, info ); 
  +                m_converterEngine.getRegistry().register( m_classname, locator ); 
               }
               catch( final RegistryException re )
               {
  
  
  
  1.3       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterDataType.java
  
  Index: RegisterDataType.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterDataType.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RegisterDataType.java	2001/05/28 06:28:09	1.2
  +++ RegisterDataType.java	2001/05/28 12:57:13	1.3
  @@ -28,7 +28,7 @@
       {
           if( null == classname )
           {
  -            try { m_engine.getTskDeployer().deployDataType( name, url.toString(), url );
}
  +            try { m_tskDeployer.deployDataType( name, url.toString(), url ); }
               catch( final DeploymentException de )
               {
                   throw new AntException( "Failed deploying " + name + " from " + url, de
);
  @@ -37,7 +37,7 @@
           else
           {
               final DefaultLocator locator = new DefaultLocator( classname, url );
  -            m_engine.getDataTypeEngine().getRegistry().register( name, locator ); 
  +            m_dataTypeEngine.getRegistry().register( name, locator ); 
           }
       }
   }
  
  
  
  1.3       +1 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklet.java
  
  Index: RegisterTasklet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RegisterTasklet.java	2001/05/28 06:28:09	1.2
  +++ RegisterTasklet.java	2001/05/28 12:57:13	1.3
  @@ -28,7 +28,7 @@
       {
           if( null == classname )
           {
  -            try { m_engine.getTskDeployer().deployTasklet( name, url.toString(), url );
}
  +            try { m_tskDeployer.deployTasklet( name, url.toString(), url ); }
               catch( final DeploymentException de )
               {
                   throw new AntException( "Failed deploying " + name + " from " + url, de
);
  
  
  
  1.4       +5 -5      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklib.java
  
  Index: RegisterTasklib.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/core/RegisterTasklib.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegisterTasklib.java	2001/05/28 07:36:44	1.3
  +++ RegisterTasklib.java	2001/05/28 12:57:13	1.4
  @@ -12,7 +12,7 @@
   import java.net.URL;
   import org.apache.ant.AntException;
   import org.apache.myrmidon.api.AbstractTask;
  -import org.apache.ant.tasklet.engine.TaskletEngine;
  +import org.apache.ant.tasklet.engine.TskDeployer;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.Composable;
  @@ -28,13 +28,13 @@
       implements Composable
   {
       protected String              m_lib;
  -    protected TaskletEngine       m_engine;
  +    protected TskDeployer         m_tskDeployer;
       
       public void compose( final ComponentManager componentManager )
           throws ComponentException
       {
  -        m_engine = (TaskletEngine)componentManager.
  -            lookup( "org.apache.ant.tasklet.engine.TaskletEngine" );
  +        m_tskDeployer = (TskDeployer)componentManager.
  +            lookup( "org.apache.ant.tasklet.engine.TskDeployer" );
       }
   
       public void setLib( final String lib )
  @@ -61,7 +61,7 @@
   
           try
           {
  -            m_engine.getTskDeployer().deploy( url.toString(), url );
  +            m_tskDeployer.deploy( url.toString(), url );
           }
           catch( final DeploymentException de )
           {
  
  
  
  1.15      +0 -29     jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/DefaultTaskletEngine.java
  
  Index: DefaultTaskletEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/DefaultTaskletEngine.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DefaultTaskletEngine.java	2001/05/28 09:06:49	1.14
  +++ DefaultTaskletEngine.java	2001/05/28 12:57:14	1.15
  @@ -40,41 +40,18 @@
       extends AbstractLoggable
       implements TaskletEngine, Composable
   {
  -    protected TskDeployer          m_tskDeployer;
       protected Factory              m_factory;
       protected Registry             m_locatorRegistry   = new DefaultRegistry( Locator.class
);
       protected Configurer           m_configurer;
  -    protected DataTypeEngine       m_dataTypeEngine;
  -    protected ConverterEngine      m_converterEngine;
   
       protected ComponentManager     m_componentManager;
   
  -    public TskDeployer getTskDeployer()
  -    {
  -        return m_tskDeployer;
  -    }
  -
  -    public ConverterEngine getConverterEngine()
  -    {
  -        return m_converterEngine;
  -    }
  -
       public Registry getRegistry()
       {
           return m_locatorRegistry;
       }
   
       /**
  -     * Retrieve datatype engine.
  -     *
  -     * @return the DataTypeEngine
  -     */
  -    public DataTypeEngine getDataTypeEngine()
  -    {
  -        return m_dataTypeEngine;
  -    }
  -
  -    /**
        * Retrieve relevent services needed to deploy.
        *
        * @param componentManager the ComponentManager
  @@ -87,14 +64,8 @@
           m_componentManager = componentManager;
   
           m_factory = (Factory)componentManager.lookup( "org.apache.avalon.framework.camelot.Factory"
);
  -        m_tskDeployer = (TskDeployer)componentManager.
  -            lookup( "org.apache.ant.tasklet.engine.TskDeployer" );
           m_configurer = (Configurer)componentManager.
               lookup( "org.apache.myrmidon.components.configurer.Configurer" );
  -        m_dataTypeEngine = (DataTypeEngine)componentManager.
  -            lookup( "org.apache.ant.tasklet.engine.DataTypeEngine" );
  -        m_converterEngine = (ConverterEngine)componentManager.
  -            lookup( "org.apache.ant.convert.engine.ConverterEngine" );
       }
   
       public void execute( final Configuration taskData, final TaskContext context )
  
  
  
  1.12      +0 -26     jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/TaskletEngine.java
  
  Index: TaskletEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/TaskletEngine.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TaskletEngine.java	2001/05/28 07:36:52	1.11
  +++ TaskletEngine.java	2001/05/28 12:57:14	1.12
  @@ -8,15 +8,10 @@
   package org.apache.ant.tasklet.engine;
   
   import org.apache.ant.AntException;
  -import org.apache.ant.convert.engine.ConverterEngine;
  -import org.apache.ant.tasklet.engine.DataTypeEngine;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.logger.Loggable;
   import org.apache.avalon.framework.camelot.Registry;
  -import org.apache.log.Logger;
    
   /**
    * Engine inteface that should be implemented by all tasklet engines.
  @@ -27,32 +22,11 @@
       extends Component
   {
       /**
  -     * Retrieve deployer for engine.
  -     *
  -     * @return the deployer
  -     */
  -    TskDeployer getTskDeployer();
  -    
  -    /**
        * Retrieve locator registry associated with engine.
        *
        * @return the LocatorRegistry
        */
       Registry getRegistry();
  -
  -    /**
  -     * Retrieve converter engine.
  -     *
  -     * @return the ConverterEngine
  -     */
  -    ConverterEngine getConverterEngine();
  -
  -    /**
  -     * Retrieve datatype engine.
  -     *
  -     * @return the DataTypeEngine
  -     */
  -    DataTypeEngine getDataTypeEngine();
       
       /**
        * execute a task.
  
  
  

Mime
View raw message