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 06:01:01 GMT
donaldp     2002/06/19 23:01:00

  Modified:    container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               container/src/test/org/apache/myrmidon/components/embeddor/test
                        DefaultEmbeddorTest.java
               container/src/java/org/apache/myrmidon/components/executor
                        DefaultExecutionFrame.java DefaultExecutor.java
               container/src/java/org/apache/myrmidon/components/workspace
                        DefaultTaskContext.java DefaultWorkspace.java
               container/src/java/org/apache/myrmidon/interfaces
                        EmbeddedAnt.java
               container/src/java/org/apache/myrmidon/interfaces/executor
                        ExecutionFrame.java
  Log:
  Add a lookup(String) method to start migrating towards a similar interface to the TaskContext
  
  Revision  Changes    Path
  1.100     +5 -1      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.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- DefaultEmbeddor.java	16 Jun 2002 04:15:26 -0000	1.99
  +++ DefaultEmbeddor.java	20 Jun 2002 06:00:58 -0000	1.100
  @@ -101,6 +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() );*/
           return m_projectBuilder.build( project );
       }
   
  
  
  
  1.36      +2 -2      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/embeddor/test/DefaultEmbeddorTest.java
  
  Index: DefaultEmbeddorTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/embeddor/test/DefaultEmbeddorTest.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- DefaultEmbeddorTest.java	13 Jun 2002 05:18:59 -0000	1.35
  +++ DefaultEmbeddorTest.java	20 Jun 2002 06:00:59 -0000	1.36
  @@ -133,7 +133,7 @@
           // Install a listener
           final LogMessageTracker listener = new LogMessageTracker();
           final TaskEventManager taskEventManager =
  -            (TaskEventManager)frame.getServiceManager().lookup( TaskEventManager.ROLE );
  +            (TaskEventManager)frame.lookup( TaskEventManager.ROLE );
           taskEventManager.addTaskListener( listener );
   
           listener.addExpectedMessage( "main-target", "A log message" );
  
  
  
  1.14      +11 -2     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultExecutionFrame.java	13 Jun 2002 03:04:35 -0000	1.13
  +++ DefaultExecutionFrame.java	20 Jun 2002 06:00:59 -0000	1.14
  @@ -67,6 +67,15 @@
       }
   
       /**
  +     * Returns the service in frame.
  +     */
  +    public Object lookup( String role )
  +        throws ServiceException
  +    {
  +        return m_serviceManager.lookup( role );
  +    }
  +
  +    /**
        * Create a {@link org.apache.myrmidon.api.TaskContext} object for current frame.
        *
        * @param taskName the name of task
  @@ -121,7 +130,7 @@
           }
           else
           {
  -            serviceManager = getServiceManager();
  +            serviceManager = m_serviceManager;
           }
   
           try
  
  
  
  1.46      +4 -6      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java
  
  Index: DefaultExecutor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- DefaultExecutor.java	13 Jun 2002 01:43:15 -0000	1.45
  +++ DefaultExecutor.java	20 Jun 2002 06:00:59 -0000	1.46
  @@ -11,7 +11,6 @@
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.service.ServiceException;
  -import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.myrmidon.api.Task;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  @@ -88,10 +87,9 @@
       private TaskEventManager getTaskEventManager( final ExecutionFrame frame )
           throws TaskException
       {
  -        final ServiceManager serviceManager = frame.getServiceManager();
           try
           {
  -            return (TaskEventManager)serviceManager.lookup( TaskEventManager.ROLE );
  +            return (TaskEventManager)frame.lookup( TaskEventManager.ROLE );
           }
           catch( final ServiceException se )
           {
  @@ -184,7 +182,7 @@
       {
           try
           {
  -            final TypeManager typeManager = (TypeManager)frame.getServiceManager().lookup(
TypeManager.ROLE );
  +            final TypeManager typeManager = (TypeManager)frame.lookup( TypeManager.ROLE
);
               final TypeFactory factory = typeManager.getFactory( Task.ROLE );
               return (Task)factory.create( name );
           }
  @@ -225,7 +223,7 @@
                                         final ExecutionFrame frame )
           throws Exception
       {
  -        final Configurer configurer = (Configurer)frame.getServiceManager().lookup( Configurer.ROLE
);
  +        final Configurer configurer = (Configurer)frame.lookup( Configurer.ROLE );
           configurer.configureElement( task, taskModel, taskContext );
       }
   
  
  
  
  1.56      +2 -4      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java
  
  Index: DefaultTaskContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- DefaultTaskContext.java	15 Jun 2002 03:12:16 -0000	1.55
  +++ DefaultTaskContext.java	20 Jun 2002 06:01:00 -0000	1.56
  @@ -13,7 +13,6 @@
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.avalon.framework.service.ServiceException;
  -import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.event.LogLevel;
  @@ -132,12 +131,11 @@
           }
   
           final String classname = clazz.getName();
  -        final ServiceManager serviceManager = m_frame.getServiceManager();
           try
           {
               // Lookup the service by role name.  Note that this will chain
               // up to parent ServiceManagers (if any)
  -            return serviceManager.lookup( classname );
  +            return m_frame.lookup( classname );
           }
           catch( final ServiceException e )
           {
  
  
  
  1.90      +6 -8      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.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- DefaultWorkspace.java	13 Jun 2002 06:17:53 -0000	1.89
  +++ DefaultWorkspace.java	20 Jun 2002 06:01:00 -0000	1.90
  @@ -26,13 +26,13 @@
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.executor.Executor;
   import org.apache.myrmidon.interfaces.model.Project;
  +import org.apache.myrmidon.interfaces.model.ProjectRef;
   import org.apache.myrmidon.interfaces.model.Target;
   import org.apache.myrmidon.interfaces.property.PropertyStore;
   import org.apache.myrmidon.interfaces.service.ScopedService;
   import org.apache.myrmidon.interfaces.type.TypeManager;
   import org.apache.myrmidon.interfaces.type.TypeRegistry;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  -import org.apache.myrmidon.interfaces.model.ProjectRef;
   import org.apache.myrmidon.interfaces.workspace.Workspace;
   
   /**
  @@ -173,7 +173,7 @@
                                           true );
   
               final PropertyStore propertyStore =
  -                (PropertyStore)childFrame.getServiceManager().lookup( PropertyStore.ROLE
);
  +                (PropertyStore)childFrame.lookup( PropertyStore.ROLE );
               propertyStore.setProperty( ProjectDescriptor.KEY,
                                          project.getProjectDescriptor() );
               final ProjectRef[] refs = project.getProjectRefs();
  @@ -262,12 +262,11 @@
       private Project getProject( final ProjectDescriptor descriptor )
           throws TaskException
       {
  -        final ServiceManager serviceManager = m_frame.getServiceManager();
           final String key = Project.KEY + '-' + descriptor.toKey();
           try
           {
               final PropertyStore propertyStore =
  -                (PropertyStore)serviceManager.lookup( PropertyStore.ROLE );
  +                (PropertyStore)m_frame.lookup( PropertyStore.ROLE );
               if( propertyStore.isPropertySet( key ) )
               {
                   return (Project)propertyStore.getProperty( key );
  @@ -288,8 +287,7 @@
       {
           try
           {
  -            final ServiceManager serviceManager = m_frame.getServiceManager();
  -            final Embeddor embeddor = (Embeddor)serviceManager.lookup( Embeddor.ROLE );
  +            final Embeddor embeddor = (Embeddor)m_frame.lookup( Embeddor.ROLE );
               return embeddor.createProject( descriptor );
           }
           catch( final Exception e )
  @@ -373,7 +371,7 @@
           Executor executor;
           try
           {
  -            executor = (Executor)frame.getServiceManager().lookup( Executor.ROLE );
  +            executor = (Executor)frame.lookup( Executor.ROLE );
           }
           catch( final ServiceException se )
           {
  
  
  
  1.30      +2 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java
  
  Index: EmbeddedAnt.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- EmbeddedAnt.java	13 Jun 2002 06:17:53 -0000	1.29
  +++ EmbeddedAnt.java	20 Jun 2002 06:01:00 -0000	1.30
  @@ -275,7 +275,7 @@
           throws Exception
       {
           final TaskEventManager eventManager =
  -            (TaskEventManager)frame.getServiceManager().lookup( TaskEventManager.ROLE );
  +            (TaskEventManager)frame.lookup( TaskEventManager.ROLE );
           final int count = m_listeners.size();
           for( int i = 0; i < count; i++ )
           {
  
  
  
  1.18      +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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ExecutionFrame.java	13 Jun 2002 01:43:14 -0000	1.17
  +++ ExecutionFrame.java	20 Jun 2002 06:01:00 -0000	1.18
  @@ -9,6 +9,7 @@
   
   import java.io.File;
   import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.interfaces.property.PropertyStore;
  @@ -51,6 +52,12 @@
        * tasks.
        */
       ServiceManager getServiceManager();
  +
  +    /**
  +     * Returns the service in frame.
  +     */
  +    Object lookup( String role )
  +        throws ServiceException;
   
       /**
        * Create a {@link TaskContext} object for current 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