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/test/org/apache/myrmidon/components/type/test DefaultTypeManagerTestCase.java
Date Fri, 21 Jun 2002 02:59:52 GMT
donaldp     2002/06/20 19:59:52

  Modified:    container/src/java/org/apache/myrmidon/components/type
                        DefaultTypeManager.java
               container/src/java/org/apache/myrmidon/interfaces/type
                        TypeManager.java
               container/src/test/org/apache/myrmidon/components/type/test
                        DefaultTypeManagerTestCase.java
  Log:
  Make TypeManager unscoped again. Moving towards having it as a passive data registry like
PropertyStore.
  
  Revision  Changes    Path
  1.28      +8 -14     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/type/DefaultTypeManager.java
  
  Index: DefaultTypeManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/type/DefaultTypeManager.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- DefaultTypeManager.java	9 Jun 2002 13:25:40 -0000	1.27
  +++ DefaultTypeManager.java	21 Jun 2002 02:59:52 -0000	1.28
  @@ -15,7 +15,6 @@
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.myrmidon.interfaces.role.RoleInfo;
   import org.apache.myrmidon.interfaces.role.RoleManager;
  -import org.apache.myrmidon.interfaces.service.ScopedService;
   import org.apache.myrmidon.interfaces.type.TypeException;
   import org.apache.myrmidon.interfaces.type.TypeFactory;
   import org.apache.myrmidon.interfaces.type.TypeManager;
  @@ -29,7 +28,7 @@
    * @version $Revision$ $Date$
    */
   public class DefaultTypeManager
  -    implements TypeRegistry, TypeManager, Serviceable, ScopedService
  +    implements TypeRegistry, TypeManager, Serviceable
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultTypeManager.class );
  @@ -44,20 +43,18 @@
   
       public DefaultTypeManager()
       {
  -        this( null );
  +        this( null, null );
       }
   
       /**
        * Create a chained DefaultTypeManager which wraps a parent TypeManager.
        * @param parent The parent TypeManager - unknown types are delegated to the parent.
        */
  -    private DefaultTypeManager( final DefaultTypeManager parent )
  +    private DefaultTypeManager( final DefaultTypeManager parent,
  +                                final RoleManager roleManager )
       {
           m_parent = parent;
  -        if( m_parent != null )
  -        {
  -            m_roleManager = m_parent.m_roleManager;
  -        }
  +        m_roleManager = roleManager;
       }
   
       /**
  @@ -108,12 +105,9 @@
           return createFactory( roleName );
       }
   
  -    /**
  -     * Creates a child of this service.
  -     */
  -    public Object createChildService() throws Exception
  +    public TypeManager getChildTypeManager( RoleManager roleManager )
       {
  -        return new DefaultTypeManager( this );
  +        return new DefaultTypeManager( this, roleManager );
       }
   
       /**
  
  
  
  1.15      +5 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/type/TypeManager.java
  
  Index: TypeManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/type/TypeManager.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TypeManager.java	27 May 2002 08:30:30 -0000	1.14
  +++ TypeManager.java	21 Jun 2002 02:59:52 -0000	1.15
  @@ -7,6 +7,8 @@
    */
   package org.apache.myrmidon.interfaces.type;
   
  +import org.apache.myrmidon.interfaces.role.RoleManager;
  +
   /**
    * This interface is used to lookup type factories.
    *
  @@ -33,4 +35,6 @@
        */
       TypeFactory getFactory( String roleName )
           throws TypeException;
  +
  +    TypeManager getChildTypeManager( RoleManager roleManager );
   }
  
  
  
  1.7       +5 -2      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/type/test/DefaultTypeManagerTestCase.java
  
  Index: DefaultTypeManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/type/test/DefaultTypeManagerTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultTypeManagerTestCase.java	27 May 2002 08:30:30 -0000	1.6
  +++ DefaultTypeManagerTestCase.java	21 Jun 2002 02:59:52 -0000	1.7
  @@ -16,6 +16,7 @@
   import org.apache.myrmidon.interfaces.type.TypeManager;
   import org.apache.myrmidon.interfaces.type.TypeRegistry;
   import org.apache.myrmidon.interfaces.role.RoleInfo;
  +import org.apache.myrmidon.interfaces.role.RoleManager;
   
   /**
    * Test cases for the DefaultTypeManager
  @@ -396,7 +397,9 @@
       private DefaultTypeManager createChild( final DefaultTypeManager parent )
           throws Exception
       {
  -        return (DefaultTypeManager)parent.createChildService();
  +        final RoleManager roleManager =
  +            (RoleManager)getServiceManager().lookup( RoleManager.ROLE );
  +        return (DefaultTypeManager)parent.getChildTypeManager( roleManager );
       }
   
   }
  
  
  

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