avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/component WrapperComponentManager.java WrapperComponentSelector.java
Date Thu, 07 Nov 2002 15:50:07 GMT
donaldp     2002/11/07 07:50:07

  Modified:    src/java/org/apache/avalon/framework/component
                        WrapperComponentManager.java
                        WrapperComponentSelector.java
  Log:
  Cascade Leifs fix to component package
  
  Revision  Changes    Path
  1.2       +11 -1     jakarta-avalon/src/java/org/apache/avalon/framework/component/WrapperComponentManager.java
  
  Index: WrapperComponentManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/WrapperComponentManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WrapperComponentManager.java	7 Nov 2002 09:06:13 -0000	1.1
  +++ WrapperComponentManager.java	7 Nov 2002 15:50:06 -0000	1.2
  @@ -13,6 +13,7 @@
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceSelector;
  +import org.apache.avalon.framework.service.WrapperServiceSelector;
   
   /**
    *  * This is a {@link ComponentManager} implementation that can wrap around a
  @@ -94,6 +95,15 @@
        */
       public void release( final Component component )
       {
  +        if( component instanceof WrapperServiceSelector )
  +        {
  +            m_manager.
  +                release( ( (WrapperComponentSelector)component ).getWrappedServiceSelector()
);
  +        }
  +        else
  +        {
  +            m_manager.release( (Component)component );
  +        }
           m_manager.release( component );
       }
   }
  
  
  
  1.2       +13 -1     jakarta-avalon/src/java/org/apache/avalon/framework/component/WrapperComponentSelector.java
  
  Index: WrapperComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/WrapperComponentSelector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WrapperComponentSelector.java	7 Nov 2002 09:06:13 -0000	1.1
  +++ WrapperComponentSelector.java	7 Nov 2002 15:50:06 -0000	1.2
  @@ -157,4 +157,16 @@
       {
           m_selector.release( object );
       }
  +
  +    /**
  +     * The {@link WrapperComponentManager} wraps ServiceSelectors in
  +     *  WrapperServiceSelectors when they are looked up.  This method
  +     *  makes it possible to release the original component selector.
  +     *
  +     * @return The {@link ServiceSelector} being wrapped.
  +     */
  +    ServiceSelector getWrappedServiceSelector()
  +    {
  +        return m_selector;
  +    }
   }
  
  
  

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