avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craft...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component DefaultComponentFactory.java
Date Sun, 12 May 2002 23:38:30 GMT
crafterm    02/05/12 16:38:30

  Modified:    component/src/java/org/apache/avalon/excalibur/component
                        DefaultComponentFactory.java
  Log:
  Documented use of the ComponentManagerProxy class within this handler
  
  Revision  Changes    Path
  1.2       +18 -1     jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/DefaultComponentFactory.java
  
  Index: DefaultComponentFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/DefaultComponentFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultComponentFactory.java	4 Apr 2002 05:09:02 -0000	1.1
  +++ DefaultComponentFactory.java	12 May 2002 23:38:30 -0000	1.2
  @@ -38,7 +38,7 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
    * @author <a href="mailto:ryan@silveregg.co.jp">Ryan Shaw</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2002/04/04 05:09:02 $
  + * @version CVS $Revision: 1.2 $ $Date: 2002/05/12 23:38:30 $
    * @since 4.0
    */
   public class DefaultComponentFactory
  @@ -172,6 +172,7 @@
   
           if( component instanceof Composable )
           {
  +            // wrap the real CM with a proxy, see below for more info
               proxy = new ComponentManagerProxy( m_componentManager );
               ( (Composable)component ).compose( proxy );
           }
  @@ -288,6 +289,8 @@
   
           if( component instanceof Composable )
           {
  +            // ensure any components looked up by this Composable are properly
  +            // released, if they haven't been released already
               ( (ComponentManagerProxy)m_components.get( component ) ).releaseAll();
           }
   
  @@ -304,6 +307,15 @@
           return m_logEnabledLogger;
       }
   
  +    /**
  +     * Proxy <code>ComponentManager</code> class to maintain references to
  +     * components looked up within a <code>Composable</code> instance created
  +     * by this factory.
  +     *
  +     * This class acts a safety net to ensure that all components looked
  +     * up within a <code>Composable</code> instance created by this factory
are 
  +     * released when the instance itself is released.
  +     */
       private static class ComponentManagerProxy implements ComponentManager
       {
           private final ComponentManager m_realManager;
  @@ -345,6 +357,11 @@
               m_unreleased.remove( component );
           }
   
  +        /**
  +         * Releases all components that have been looked up through this 
  +         * <code>ComponentManager</code>, that have not yet been released
  +         * via user code.
  +         */
           private void releaseAll()
           {
               Component[] unreleased;
  
  
  

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


Mime
View raw message