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/components/workspace DefaultWorkspace.java
Date Tue, 21 May 2002 05:49:48 GMT
donaldp     02/05/20 22:49:48

  Modified:    container/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java
  Log:
  Use supplied frame for all your execution needs
  
  Revision  Changes    Path
  1.64      +17 -11    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java
  
  Index: DefaultWorkspace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- DefaultWorkspace.java	21 May 2002 05:32:26 -0000	1.63
  +++ DefaultWorkspace.java	21 May 2002 05:49:48 -0000	1.64
  @@ -12,7 +12,7 @@
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.service.DefaultServiceManager;
  -import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.metadata.ModelElement;
   import org.apache.myrmidon.interfaces.deployer.Deployer;
  @@ -29,7 +29,7 @@
    * This is the default implementation of Workspace.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.63 $ $Date: 2002/05/21 05:32:26 $
  + * @version $Revision: 1.64 $ $Date: 2002/05/21 05:49:48 $
    */
   public class DefaultWorkspace
       extends AbstractLogEnabled
  @@ -43,9 +43,6 @@
        */
       private static final String IMPLICIT_TARGET_NAME = "<init>";
   
  -    private Executor m_executor;
  -    private TypeManager m_typeManager;
  -
       /** A map from Project object -> ProjectEntry for that project. */
       private HashMap m_entries = new HashMap();
   
  @@ -55,9 +52,6 @@
       public void setRootExecutionFrame( final ExecutionFrame frame )
           throws Exception
       {
  -        final ServiceManager serviceManager = frame.getServiceManager();
  -        m_typeManager = (TypeManager)serviceManager.lookup( TypeManager.ROLE );
  -        m_executor = (Executor)serviceManager.lookup( Executor.ROLE );
       }
   
       /**
  @@ -89,9 +83,11 @@
           final DefaultServiceManager serviceManager =
               new DefaultServiceManager( frame.getServiceManager() );
   
  +        final TypeManager parentTypeManager =
  +            (TypeManager)serviceManager.lookup( TypeManager.ROLE );
           //Add in child type manager so each frame can register different
           //sets of tasks etc
  -        final TypeManager typeManager = m_typeManager.createChildTypeManager();
  +        final TypeManager typeManager = parentTypeManager.createChildTypeManager();
           serviceManager.put( TypeManager.ROLE, typeManager );
   
           // TODO - Add child role manager and configurer
  @@ -275,8 +271,18 @@
               targetModel.addChild( tasks[ i ] );
           }
   
  -        final ExecutionFrame frame = entry.getFrame().createChildFrame( name, null, null,
false );
  -        m_executor.execute( targetModel, frame );
  +        final ExecutionFrame frame =
  +            entry.getFrame().createChildFrame( name, null, null, false );
  +        Executor executor;
  +        try
  +        {
  +            executor = (Executor)frame.getServiceManager().lookup( Executor.ROLE );
  +        }
  +        catch( final ServiceException se )
  +        {
  +            throw new TaskException( se.getMessage(), se );
  +        }
  +        executor.execute( targetModel, frame );
       }
   
       /**
  
  
  

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