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/myrmidon/components/manager DefaultProjectManager.java
Date Tue, 12 Jun 2001 14:19:55 GMT
donaldp     01/06/12 07:19:55

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/components/executor
                        DefaultExecutionFrame.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/manager
                        DefaultProjectManager.java
  Log:
  Moved getChildTypeManager to ProjectManager as havin in ExecutionFrame violates IOC and
has not consistent with other approach for frame specific parameters.
  
  Revision  Changes    Path
  1.2       +4 -7      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutionFrame.java
  
  Index: DefaultExecutionFrame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutionFrame.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultExecutionFrame.java	2001/06/12 13:38:29	1.1
  +++ DefaultExecutionFrame.java	2001/06/12 14:19:54	1.2
  @@ -36,9 +36,10 @@
       implements ExecutionFrame, Loggable, Contextualizable, Composable
   {
       private TypeManager              m_typeManager;
  +
       private Logger                   m_logger;
       private TaskContext              m_context;
  -    private DefaultComponentManager  m_componentManager = new DefaultComponentManager();
  +    private ComponentManager         m_componentManager;
   
       public void setLogger( final Logger logger )
       {
  @@ -91,13 +92,9 @@
               (ConverterRegistry)componentManager.lookup( ConverterRegistry.ROLE );
           m_componentManager.put( ConverterRegistry.ROLE, converterRegistry );
   */
  -        m_componentManager = new DefaultComponentManager( componentManager );
  +        m_componentManager = componentManager;
   
  -        //Extend from inherited version
  -        final TypeManager typeManager = (TypeManager)componentManager.lookup( TypeManager.ROLE
);
  -        m_typeManager = typeManager.createChildTypeManager();
  -        //m_typeManager = typeManager;
  -        m_componentManager.put( TypeManager.ROLE, m_typeManager );
  +        m_typeManager = (TypeManager)componentManager.lookup( TypeManager.ROLE );
       }
   
       public TypeManager getTypeManager()
  
  
  
  1.7       +9 -4      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/manager/DefaultProjectManager.java
  
  Index: DefaultProjectManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/manager/DefaultProjectManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultProjectManager.java	2001/06/12 13:59:41	1.6
  +++ DefaultProjectManager.java	2001/06/12 14:19:54	1.7
  @@ -32,6 +32,7 @@
   import org.apache.myrmidon.components.model.Condition;
   import org.apache.myrmidon.components.model.Project;
   import org.apache.myrmidon.components.model.Target;
  +import org.apache.myrmidon.components.type.TypeManager;
   import org.apache.myrmidon.listeners.ProjectListener;
   
   /**
  @@ -45,11 +46,12 @@
   {
       private Executor                 m_executor;
       private ProjectListenerSupport   m_listenerSupport   = new ProjectListenerSupport();
  -    private DefaultComponentManager  m_componentManager;
  +    private ComponentManager         m_componentManager;
       private Parameters               m_parameters;
       private Project                  m_project;
       private TaskContext              m_baseContext;
       private HashMap                  m_entrys            = new HashMap();
  +    private TypeManager              m_typeManager;
   
       /**
        * Add a listener to project events.
  @@ -80,8 +82,9 @@
       public void compose( final ComponentManager componentManager )
           throws ComponentException
       {
  -        m_componentManager = new DefaultComponentManager( componentManager );
  +        m_componentManager = componentManager;
   
  +        m_typeManager = (TypeManager)componentManager.lookup( TypeManager.ROLE );
           m_executor = (Executor)componentManager.lookup( Executor.ROLE );
           m_project = (Project)componentManager.lookup( Project.ROLE );
       }
  @@ -149,6 +152,10 @@
           final DefaultComponentManager componentManager = 
               new DefaultComponentManager( m_componentManager );
   
  +        //Add in child type manager so each frame can register different 
  +        //sets of tasks etc
  +        componentManager.put( TypeManager.ROLE, m_typeManager.createChildTypeManager()
);
  +
           //We need to place projects and ProjectManager
           //in ComponentManager so as to support project-local antcall
           componentManager.put( ProjectManager.ROLE, this );
  @@ -161,8 +168,6 @@
               final Project other = project.getProject( name );
               componentManager.put( Project.ROLE + "/" + name, other );
           }
  -
  -        //Per frame TypeManager here...
   
           final DefaultExecutionFrame frame = new DefaultExecutionFrame();
                  
  
  
  

Mime
View raw message