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/executor DefaultExecutionFrame.java
Date Fri, 21 Jun 2002 03:01:09 GMT
donaldp     2002/06/20 20:01:09

  Modified:    container/src/java/org/apache/myrmidon/components/executor
                        DefaultExecutionFrame.java
  Log:
  Rework the ugly hack so that scoping occurs in frame in hardwired ugly manner.
  
  Revision  Changes    Path
  1.20      +33 -14    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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultExecutionFrame.java	21 Jun 2002 00:45:16 -0000	1.19
  +++ DefaultExecutionFrame.java	21 Jun 2002 03:01:09 -0000	1.20
  @@ -17,6 +17,11 @@
   import org.apache.myrmidon.interfaces.event.TaskEventManager;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.property.PropertyStore;
  +import org.apache.myrmidon.interfaces.service.AntServiceKernel;
  +import org.apache.myrmidon.interfaces.type.TypeManager;
  +import org.apache.myrmidon.interfaces.type.TypeRegistry;
  +import org.apache.myrmidon.interfaces.role.RoleManager;
  +import org.apache.myrmidon.interfaces.role.RoleRegistry;
   
   /**
    * Frames in which tasks are executed.
  @@ -122,25 +127,39 @@
       public ExecutionFrame createPartition( final String name,
                                              final File baseDirectory )
       {
  -        final String newName = getName() + "/" + name;
  -
  -        final DefaultServiceManager dsm = new DefaultServiceManager( m_serviceManager );
  +        //What an UGLY Hack!!!
           try
           {
  -            //What an UGLY Hack!!!
  -            final PropertyStore basePropertyStore =
  -                (PropertyStore)m_serviceManager.lookup( PropertyStore.ROLE );
  -            final PropertyStore propertyStore = basePropertyStore.createChildStore();
  -            dsm.put( PropertyStore.ROLE, propertyStore );
  +            final PropertyStore basePS = (PropertyStore)lookup( PropertyStore.ROLE );
  +            final PropertyStore ps = basePS.createChildStore();
  +
  +            final RoleManager baseRM = (RoleManager)lookup( RoleManager.ROLE );
  +            final RoleManager rm = baseRM;
  +
  +            final TypeManager baseTM = (TypeManager)lookup( TypeManager.ROLE );
  +            final TypeManager tm = baseTM.getChildTypeManager( rm );
  +
  +            final AntServiceKernel baseSK = (AntServiceKernel)lookup( AntServiceKernel.ROLE
);
  +            final AntServiceKernel sk = baseSK.createChild();
  +
  +            final DefaultServiceManager dsm = new DefaultServiceManager( m_serviceManager
);
  +            dsm.put( PropertyStore.ROLE, ps );
  +            dsm.put( AntServiceKernel.ROLE, sk );
  +
  +            dsm.put( RoleManager.ROLE, rm );
  +            dsm.put( RoleRegistry.ROLE, rm );
  +
  +            dsm.put( TypeManager.ROLE, tm );
  +            dsm.put( TypeRegistry.ROLE, tm );
  +
  +            return new DefaultExecutionFrame( getName() + "/" + name,
  +                                              baseDirectory,
  +                                              dsm );
           }
  -        catch( final ServiceException se )
  +        catch( final TaskException se )
           {
               throw new IllegalStateException( se.toString() );
           }
  -
  -        return new DefaultExecutionFrame( newName,
  -                                          baseDirectory,
  -                                          dsm );
       }
   
       public ExecutionFrame createChildFrame( String name )
  
  
  

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