avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler AbstractComponentHandler.java LEAwareComponentHandler.java
Date Wed, 04 Dec 2002 12:18:36 GMT
proyal      2002/12/04 04:18:36

  Modified:    fortress/src/java/org/apache/excalibur/fortress/handler
                        AbstractComponentHandler.java
                        LEAwareComponentHandler.java
  Log:
  Changes inspired by Christopher Kohlhaas <christophert@einfachanders.de>
  
  * Have LEAwareComponentHandler disposed its underlying ComponentHandler
  * Dont allow ComponentHandlerst hat extend AbstractComponentHandler to prepare
  themselves after being disposed of
  
  Revision  Changes    Path
  1.42      +10 -1     jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/AbstractComponentHandler.java
  
  Index: AbstractComponentHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/AbstractComponentHandler.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- AbstractComponentHandler.java	12 Nov 2002 04:05:02 -0000	1.41
  +++ AbstractComponentHandler.java	4 Dec 2002 12:18:36 -0000	1.42
  @@ -151,6 +151,15 @@
               return;
           }
   
  +        if( m_disposed )
  +        {
  +            final String message = "Attempted to prepare disposed ComponentHandler for
: " +
  +                m_factory.getCreatedClass().getName();
  +            m_logger.warn( message );
  +
  +            return;
  +        }
  +
           doPrepare();
   
           if( m_logger.isDebugEnabled() )
  
  
  
  1.6       +9 -2      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/LEAwareComponentHandler.java
  
  Index: LEAwareComponentHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/LEAwareComponentHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LEAwareComponentHandler.java	24 Nov 2002 16:45:19 -0000	1.5
  +++ LEAwareComponentHandler.java	4 Dec 2002 12:18:36 -0000	1.6
  @@ -50,6 +50,8 @@
   package org.apache.excalibur.fortress.handler;
   
   import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.activity.Disposable;
  +import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.excalibur.fortress.lifecycle.LifecycleExtensionManager;
   
   /**
  @@ -60,7 +62,7 @@
    * @version CVS $Revision$ $Date$
    */
   public class LEAwareComponentHandler
  -    implements ComponentHandler
  +    implements ComponentHandler, Disposable
   {
       private final ComponentHandler m_componentHandler;
       private final LifecycleExtensionManager m_extManager;
  @@ -123,5 +125,10 @@
               // REVISIT(MC): we need to log this somewhere
           }
           m_componentHandler.put( component );
  +    }
  +
  +    public void dispose()
  +    {
  +        ContainerUtil.dispose( m_componentHandler );
       }
   }
  
  
  

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