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/interfaces/executor ExecutionFrame.java
Date Thu, 20 Jun 2002 08:14:05 GMT
donaldp     2002/06/20 01:14:05

  Modified:    container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               container/src/java/org/apache/myrmidon/components/executor
                        DefaultExecutionFrame.java
               container/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java
               container/src/java/org/apache/myrmidon/interfaces/executor
                        ExecutionFrame.java
  Log:
  Temporarily allow you to register service on frame. This is a HACK to ease evolution
  
  Revision  Changes    Path
  1.101     +8 -8      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.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- DefaultEmbeddor.java	20 Jun 2002 06:00:58 -0000	1.100
  +++ DefaultEmbeddor.java	20 Jun 2002 08:14:05 -0000	1.101
  @@ -20,13 +20,13 @@
   import org.apache.avalon.framework.activity.Startable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  +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.service.DefaultServiceManager;
   import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  @@ -101,10 +101,10 @@
       public Project createProject( final ProjectDescriptor project )
           throws Exception
       {
  - /*       final TypeFactory factory = m_typeManager.getFactory( ModelBuilder.ROLE );
  -        final ModelBuilder modelBuilder =
  -            (ModelBuilder)factory.create( project.getType() );
  -        final ModelElement model = modelBuilder.build( project.getUri() );*/
  +        /*       final TypeFactory factory = m_typeManager.getFactory( ModelBuilder.ROLE
);
  +               final ModelBuilder modelBuilder =
  +                   (ModelBuilder)factory.create( project.getType() );
  +               final ModelElement model = modelBuilder.build( project.getUri() );*/
           return m_projectBuilder.build( project );
       }
   
  @@ -243,7 +243,6 @@
           m_context = null;
       }
   
  -
       public void execute( final ExecutionFrame frame,
                            final ProjectDescriptor project,
                            final String target )
  @@ -257,6 +256,7 @@
        * Creates a new workspace to execute this project in.
        */
       private Workspace createWorkspace( final ExecutionFrame frame )
  +        throws TaskException
       {
           final DefaultWorkspace workspace = new DefaultWorkspace();
           setupLogger( workspace );
  @@ -282,7 +282,7 @@
           }
   
           // Add this embeddor
  -        registry.registerService( new String[] { Embeddor.ROLE }, this );
  +        registry.registerService( new String[]{Embeddor.ROLE}, this );
       }
   
       /**
  
  
  
  1.17      +13 -3     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/executor/DefaultExecutionFrame.java
  
  Index: DefaultExecutionFrame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/executor/DefaultExecutionFrame.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DefaultExecutionFrame.java	20 Jun 2002 07:54:44 -0000	1.16
  +++ DefaultExecutionFrame.java	20 Jun 2002 08:14:05 -0000	1.17
  @@ -29,7 +29,7 @@
   {
       private final String m_name;
       private final File m_baseDirectory;
  -    private final ServiceManager m_serviceManager;
  +    private final DefaultServiceManager m_serviceManager;
   
       public DefaultExecutionFrame( final String name,
                                     final File baseDirectory,
  @@ -37,7 +37,7 @@
       {
           m_name = name;
           m_baseDirectory = baseDirectory;
  -        m_serviceManager = serviceManager;
  +        m_serviceManager = new DefaultServiceManager( serviceManager );
       }
   
       /**
  @@ -80,6 +80,16 @@
           {
               throw new TaskException( se.getMessage(), se );
           }
  +    }
  +
  +    /**
  +     * Register the service in frame.
  +     * @todo Remove me as I am an ugly hack!!!
  +     */
  +    public void registerService( String role, Object service )
  +        throws TaskException
  +    {
  +        m_serviceManager.put( role, service );
       }
   
       /**
  
  
  
  1.93      +3 -2      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.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- DefaultWorkspace.java	20 Jun 2002 07:54:44 -0000	1.92
  +++ DefaultWorkspace.java	20 Jun 2002 08:14:05 -0000	1.93
  @@ -55,8 +55,10 @@
        * Sets the root execution frame for this workspace.
        */
       public void setFrame( final ExecutionFrame frame )
  +        throws TaskException
       {
           m_frame = frame;
  +        m_frame.registerService( Workspace.ROLE, this );
       }
   
       public void execute( final ProjectDescriptor descriptor,
  @@ -153,7 +155,6 @@
               // TODO - Add child role manager and configurer
   
               // TODO - we never dispose of these services.  That's bad
  -            serviceManager.put( Workspace.ROLE, this );
   
               final String projectName = project.getProjectName();
               final File baseDirectory = project.getBaseDirectory();
  
  
  
  1.21      +8 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/executor/ExecutionFrame.java
  
  Index: ExecutionFrame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/executor/ExecutionFrame.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ExecutionFrame.java	20 Jun 2002 07:54:44 -0000	1.20
  +++ ExecutionFrame.java	20 Jun 2002 08:14:05 -0000	1.21
  @@ -92,4 +92,11 @@
                                        ServiceManager serviceManager );
   
       ExecutionFrame createChildFrame( String name );
  +
  +    /**
  +     * Register the service in frame.
  +     * @todo Remove me as I am an ugly hack!!!
  +     */
  +    public void registerService( String role, Object service )
  +        throws TaskException;
   }
  
  
  

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