avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon/merlin/facilities/finder/ecm/src/test/org/apache/avalon/finder/ecm/test ECMTestCase.java
Date Fri, 12 Mar 2004 08:00:42 GMT
mcconnell    2004/03/12 00:00:42

  Modified:    merlin/facilities/finder/ecm/src/java/org/apache/avalon/finder/ecm
                        DefaultRoleManager.java ECM.java
               merlin/facilities/finder/ecm/src/test/org/apache/avalon/finder/ecm/test
                        ECMTestCase.java
  Log:
  Cleanup code based on injection model.
  
  Revision  Changes    Path
  1.3       +14 -6     avalon/merlin/facilities/finder/ecm/src/java/org/apache/avalon/finder/ecm/DefaultRoleManager.java
  
  Index: DefaultRoleManager.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/facilities/finder/ecm/src/java/org/apache/avalon/finder/ecm/DefaultRoleManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultRoleManager.java	9 Mar 2004 00:27:08 -0000	1.2
  +++ DefaultRoleManager.java	12 Mar 2004 08:00:42 -0000	1.3
  @@ -36,19 +36,27 @@
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public class DefaultRoleManager implements RoleManager, Configurable
  +public class DefaultRoleManager implements RoleManager
   {
       //-----------------------------------------------------------
  -    // state
  +    // immutable state
       //-----------------------------------------------------------
   
  -    private Role[] m_roles;
  +    private final Role[] m_roles;
   
       //-----------------------------------------------------------
  -    // Configurable
  +    // constructor
       //-----------------------------------------------------------
   
  -    public void configure( Configuration config ) 
  +   /**
  +    * Creationn of a new role manager.
  +    *
  +    * @param config a configuration containing a set of &lt;role&dt;
  +    *    elements from which a roles model may be constructed
  +    * @exception ConfigurationException if an error occurs while 
  +    *    parsing configuration content relative to the role format.
  +    */
  +    public DefaultRoleManager( Configuration config ) 
         throws ConfigurationException
       {
           Configuration[] children = config.getChildren( "role" );
  
  
  
  1.3       +11 -26    avalon/merlin/facilities/finder/ecm/src/java/org/apache/avalon/finder/ecm/ECM.java
  
  Index: ECM.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/facilities/finder/ecm/src/java/org/apache/avalon/finder/ecm/ECM.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ECM.java	9 Mar 2004 00:27:08 -0000	1.2
  +++ ECM.java	12 Mar 2004 08:00:42 -0000	1.3
  @@ -40,7 +40,7 @@
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public class ECM implements ServiceManager, Configurable, Initializable
  +public class ECM implements ServiceManager
   {
       //---------------------------------------------------------
       // immutable state
  @@ -61,11 +61,10 @@
        */
       private final RoleManager m_manager;
   
  -    //---------------------------------------------------------
  -    // state
  -    //---------------------------------------------------------
  -
  -    private Configuration m_config;
  +    /**
  +     * The master configuration.
  +     */
  +    private final Configuration m_config;
   
       //---------------------------------------------------------
       // constructor
  @@ -79,40 +78,26 @@
       * 
       * @param logger the container assigned logging channel
       * @param manager the container assigned service manager
  +    * @param config the master configuration
  +    *
       * @avalon.dependency key="finder"
       *    type="org.apache.avalon.finder.Finder" 
       * @avalon.dependency key="roles"
       *    type="org.apache.avalon.finder.ecm.RoleManager" 
       */
       public ECM( 
  -      final Logger logger, ServiceManager manager ) 
  +      final Logger logger, ServiceManager manager, Configuration config ) 
         throws ServiceException
       {
           assertNotNull( logger, "logger" );
           assertNotNull( manager, "manager" );
  +        assertNotNull( config, "config" );
   
           m_logger = logger;
  +        m_config = config;
           m_finder = (Finder) manager.lookup( "finder" );
           m_manager = (RoleManager) manager.lookup( "roles" );
  -    }
   
  -    //-----------------------------------------------------------
  -    // Configurable
  -    //-----------------------------------------------------------
  -
  -    public void configure( Configuration config ) 
  -      throws ConfigurationException
  -    {
  -        assertNotNull( config, "config" );
  -        m_config = config;
  -    }
  -
  -    //-----------------------------------------------------------
  -    // Initializable
  -    //-----------------------------------------------------------
  -
  -    public void initialize()
  -    {
           getLogger().info( "commencing ecm initialization" );
   
           //
  
  
  
  1.2       +2 -2      avalon/merlin/facilities/finder/ecm/src/test/org/apache/avalon/finder/ecm/test/ECMTestCase.java
  
  Index: ECMTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/facilities/finder/ecm/src/test/org/apache/avalon/finder/ecm/test/ECMTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ECMTestCase.java	8 Mar 2004 01:36:08 -0000	1.1
  +++ ECMTestCase.java	12 Mar 2004 08:00:42 -0000	1.2
  @@ -50,7 +50,7 @@
       {
           try
           {
  -            ServiceManager ecm = new ECM( null, null );
  +            ServiceManager ecm = new ECM( null, null, null );
               fail( "did not throw an NPE" );
           }
           catch( NullPointerException npe )
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message