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-excalibur/component/src/test/org/apache/avalon/excalibur/component/test ExcaliburComponentManagerTestCase.java
Date Sat, 18 May 2002 05:13:06 GMT
donaldp     02/05/17 22:13:06

  Modified:    component/src/java/org/apache/avalon/excalibur/component
                        Tag: ECM_LOGENABLED ComponentHandler.java
                        DefaultComponentFactory.java
                        DefaultComponentHandler.java
                        DefaultRoleManager.java
                        ExcaliburComponentManager.java
                        ExcaliburComponentSelector.java
                        LogKit2LoggerTarget.java
                        PoolableComponentHandler.java
                        ThreadSafeComponentHandler.java
               component/src/test/org/apache/avalon/excalibur/component/test
                        Tag: ECM_LOGENABLED
                        ExcaliburComponentManagerTestCase.java
  Log:
  LogEnable all the ECM.
  
  Problems still to tackle:
  * hosted components that are LogKitManageable
  * Removal of LogkitManageable and replacement with LoggerManageable
  * unit tests still need fixing
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +4 -4      jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ComponentHandler.java
  
  Index: ComponentHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ComponentHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ComponentHandler.java	13 May 2002 12:17:41 -0000	1.2
  +++ ComponentHandler.java	18 May 2002 05:13:05 -0000	1.2.2.1
  @@ -15,7 +15,7 @@
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.SingleThreaded;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  @@ -26,13 +26,13 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:ryan@silveregg.co.jp">Ryan Shaw</a>
    * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2002/05/13 12:17:41 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2002/05/18 05:13:05 $
    * @since 4.0
    */
  -public abstract class ComponentHandler extends AbstractLoggable
  +public abstract class ComponentHandler
  +    extends AbstractLogEnabled
       implements Initializable, Disposable
   {
  -
       private Object m_referenceSemaphore = new Object();
       private int m_references = 0;
   
  
  
  
  1.2.2.1   +20 -23    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.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- DefaultComponentFactory.java	12 May 2002 23:38:30 -0000	1.2
  +++ DefaultComponentFactory.java	18 May 2002 05:13:05 -0000	1.2.2.1
  @@ -24,10 +24,11 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.LogKitLogger;
   import org.apache.avalon.framework.logger.Loggable;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.thread.ThreadSafe;
  @@ -38,11 +39,11 @@
    * @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.2 $ $Date: 2002/05/12 23:38:30 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2002/05/18 05:13:05 $
    * @since 4.0
    */
   public class DefaultComponentFactory
  -    extends AbstractLoggable
  +    extends AbstractLogEnabled
       implements ObjectFactory, Disposable, ThreadSafe
   {
       /** The class which this <code>ComponentFactory</code>
  @@ -70,15 +71,15 @@
        */
       private LogKitManager m_logkit;
   
  -    /** The org.apache.avalon.framework.logger.Logger instance.
  -     */
  -    private org.apache.avalon.framework.logger.Logger m_logEnabledLogger;
  -
       /** Components created by this factory, and their associated ComponentManager
        *  proxies, if they are Composables.
        */
       private final BucketMap m_components = new BucketMap();
   
  +    /** The LogKitManager for child ComponentSelectors
  +     */
  +    private org.apache.log.Logger m_logKitLogger;
  +
       /**
        * Construct a new component factory for the specified component.
        *
  @@ -103,6 +104,12 @@
           m_logkit = logkit;
       }
   
  +    public void enableLogging( final Logger logger )
  +    {
  +        super.enableLogging( logger );
  +        m_logKitLogger = LogKit2LoggerTarget.createLogger( logger );
  +    }
  +
       public Object newInstance()
           throws Exception
       {
  @@ -118,7 +125,7 @@
           {
               if( null == m_logkit || null == m_configuration )
               {
  -                ( (LogEnabled)component ).enableLogging( getLogEnabledLogger() );
  +                ( (LogEnabled)component ).enableLogging( getLogger() );
               }
               else
               {
  @@ -126,7 +133,7 @@
                   if( null == logger )
                   {
                       getLogger().debug( "no logger attribute available, using standard logger"
);
  -                    ( (LogEnabled)component ).enableLogging( getLogEnabledLogger() );
  +                    ( (LogEnabled)component ).enableLogging( getLogger() );
                   }
                   else
                   {
  @@ -140,7 +147,7 @@
           {
               if( null == m_logkit || null == m_configuration )
               {
  -                ( (Loggable)component ).setLogger( getLogger() );
  +                ( (Loggable)component ).setLogger( m_logKitLogger );
               }
               else
               {
  @@ -148,7 +155,7 @@
                   if( null == logger )
                   {
                       getLogger().debug( "no logger attribute available, using standard logger"
);
  -                    ( (Loggable)component ).setLogger( getLogger() );
  +                    ( (Loggable)component ).setLogger( m_logKitLogger );
                   }
                   else
                   {
  @@ -297,23 +304,13 @@
           m_components.remove( component );
       }
   
  -    protected org.apache.avalon.framework.logger.Logger getLogEnabledLogger()
  -    {
  -        if( null == m_logEnabledLogger )
  -        {
  -            m_logEnabledLogger = new LogKitLogger( getLogger() );
  -        }
  -
  -        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 
  +     * 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
  @@ -358,7 +355,7 @@
           }
   
           /**
  -         * Releases all components that have been looked up through this 
  +         * Releases all components that have been looked up through this
            * <code>ComponentManager</code>, that have not yet been released
            * via user code.
            */
  
  
  
  1.1.2.1   +8 -9      jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/DefaultComponentHandler.java
  
  Index: DefaultComponentHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/DefaultComponentHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- DefaultComponentHandler.java	4 Apr 2002 05:09:02 -0000	1.1
  +++ DefaultComponentHandler.java	18 May 2002 05:13:05 -0000	1.1.2.1
  @@ -13,7 +13,7 @@
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.log.Logger;
  +import org.apache.avalon.framework.logger.Logger;
   
   /**
    * The DefaultComponentHandler to make sure components are initialized
  @@ -22,7 +22,7 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:ryan@silveregg.co.jp">Ryan Shaw</a>
    * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2002/04/04 05:09:02 $
  + * @version CVS $Revision: 1.1.2.1 $ $Date: 2002/05/18 05:13:05 $
    * @since 4.0
    */
   public class DefaultComponentHandler
  @@ -32,10 +32,10 @@
       private final DefaultComponentFactory m_factory;
   
       /** State management boolean stating whether the Handler is initialized or not */
  -    private boolean m_initialized = false;
  +    private boolean m_initialized;
   
       /** State management boolean stating whether the Handler is disposed or not */
  -    private boolean m_disposed = false;
  +    private boolean m_disposed;
   
       /**
        * Create a ComponentHandler that takes care of hiding the details of
  @@ -73,11 +73,10 @@
       /**
        * Sets the logger that the ComponentHandler will use.
        */
  -    public void setLogger( final Logger logger )
  +    public void enableLogging( final Logger logger )
       {
  -        m_factory.setLogger( logger );
  -
  -        super.setLogger( logger );
  +        m_factory.enableLogging( logger );
  +        super.enableLogging( logger );
       }
   
       /**
  @@ -92,7 +91,7 @@
   
           if( getLogger().isDebugEnabled() )
           {
  -            getLogger().debug( "ComponentHandler initialized for: " + this.m_factory.getCreatedClass().getName()
);
  +            getLogger().debug( "ComponentHandler initialized for: " + m_factory.getCreatedClass().getName()
);
           }
           m_initialized = true;
       }
  
  
  
  1.1.2.1   +3 -3      jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/DefaultRoleManager.java
  
  Index: DefaultRoleManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/DefaultRoleManager.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- DefaultRoleManager.java	4 Apr 2002 05:09:02 -0000	1.1
  +++ DefaultRoleManager.java	18 May 2002 05:13:05 -0000	1.1.2.1
  @@ -13,7 +13,7 @@
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   
   /**
    * Default RoleManager implementation.  It populates the RoleManager
  @@ -22,11 +22,11 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2002/04/04 05:09:02 $
  + * @version CVS $Revision: 1.1.2.1 $ $Date: 2002/05/18 05:13:05 $
    * @since 4.0
    */
   public class DefaultRoleManager
  -    extends AbstractLoggable
  +    extends AbstractLogEnabled
       implements RoleManager, Configurable
   {
       /** Map for shorthand to role mapping */
  
  
  
  1.5.2.1   +7 -7      jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManager.java
  
  Index: ExcaliburComponentManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManager.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- ExcaliburComponentManager.java	13 May 2002 12:17:41 -0000	1.5
  +++ ExcaliburComponentManager.java	18 May 2002 05:13:05 -0000	1.5.2.1
  @@ -24,7 +24,7 @@
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   
   /**
    * Default component manager for Avalon's components.
  @@ -32,11 +32,11 @@
    * @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.5 $ $Date: 2002/05/13 12:17:41 $
  + * @version CVS $Revision: 1.5.2.1 $ $Date: 2002/05/18 05:13:05 $
    * @since 4.0
    */
   public class ExcaliburComponentManager
  -    extends AbstractLoggable
  +    extends AbstractLogEnabled
       implements ComponentManager,
       Configurable,
       Contextualizable,
  @@ -308,7 +308,7 @@
                                                          m_roles,
                                                          m_logkit );
   
  -                        handler.setLogger( getLogger() );
  +                        handler.enableLogging( getLogger() );
                           handler.initialize();
                       }
                       catch( final Exception e )
  @@ -393,7 +393,7 @@
           if( null == m_roles )
           {
               DefaultRoleManager role_info = new DefaultRoleManager();
  -            role_info.setLogger( getLogger() );
  +            role_info.enableLogging( getLogger() );
               role_info.configure( configuration );
               m_roles = role_info;
               getLogger().debug( "No RoleManager given, deriving one from configuration"
);
  @@ -625,7 +625,7 @@
                   getLogger().debug( "Handler type = " + handler.getClass().getName() );
               }
   
  -            handler.setLogger( getLogger() );
  +            handler.enableLogging( getLogger() );
               m_componentHandlers.put( role, handler );
           }
           catch( final Exception e )
  @@ -650,7 +650,7 @@
           {
               ComponentHandler handler =
                   ComponentHandler.getComponentHandler( instance );
  -            handler.setLogger( getLogger() );
  +            handler.enableLogging( getLogger() );
               m_componentHandlers.put( role, handler );
           }
           catch( final Exception e )
  
  
  
  1.4.2.1   +6 -6      jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentSelector.java
  
  Index: ExcaliburComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentSelector.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- ExcaliburComponentSelector.java	13 May 2002 12:17:41 -0000	1.4
  +++ ExcaliburComponentSelector.java	18 May 2002 05:13:06 -0000	1.4.2.1
  @@ -25,7 +25,7 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
   /**
  @@ -33,11 +33,11 @@
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.4 $ $Date: 2002/05/13 12:17:41 $
  + * @version CVS $Revision: 1.4.2.1 $ $Date: 2002/05/18 05:13:06 $
    * @since 4.0
    */
   public class ExcaliburComponentSelector
  -    extends AbstractLoggable
  +    extends AbstractLogEnabled
       implements Contextualizable,
       ComponentSelector,
       Composable,
  @@ -482,7 +482,7 @@
       /** Add a new component to the manager.
        * @param hint the hint name for the new component.
        * @param component the class of this component.
  -     * @param Configuration the configuration for this component.
  +     * @param configuration the configuration for this component.
        */
       public void addComponent( final Object hint,
                                 final Class component,
  @@ -503,7 +503,7 @@
                                                                     m_roles,
                                                                     m_logkit );
   
  -            handler.setLogger( getLogger() );
  +            handler.enableLogging( getLogger() );
               handler.initialize();
               m_componentHandlers.put( hint, handler );
   
  @@ -540,7 +540,7 @@
           {
               final ComponentHandler handler =
                   ComponentHandler.getComponentHandler( instance );
  -            handler.setLogger( getLogger() );
  +            handler.enableLogging( getLogger() );
               handler.initialize();
               m_componentHandlers.put( hint, handler );
   
  
  
  
  1.1.2.2   +12 -1     jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/Attic/LogKit2LoggerTarget.java
  
  Index: LogKit2LoggerTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/Attic/LogKit2LoggerTarget.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- LogKit2LoggerTarget.java	18 May 2002 04:47:29 -0000	1.1.2.1
  +++ LogKit2LoggerTarget.java	18 May 2002 05:13:06 -0000	1.1.2.2
  @@ -11,18 +11,29 @@
   import org.apache.log.LogEvent;
   import org.apache.log.LogTarget;
   import org.apache.log.Priority;
  +import org.apache.log.Hierarchy;
   
   /**
    * A basic LogKit target that routes from LogKit to
    * Avalon Logger.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1.2.1 $ $Date: 2002/05/18 04:47:29 $
  + * @version $Revision: 1.1.2.2 $ $Date: 2002/05/18 05:13:06 $
    */
   class LogKit2LoggerTarget
       implements LogTarget
   {
       private final Logger m_logger;
  +
  +    static org.apache.log.Logger createLogger( final Logger logger )
  +    {
  +        final Hierarchy hierarchy = new Hierarchy();
  +        final org.apache.log.Logger logKitLogger = hierarchy.getLoggerFor( "" );
  +        final LogKit2LoggerTarget target =
  +            new LogKit2LoggerTarget( logger );
  +        logKitLogger.setLogTargets( new LogTarget[ ] { target } );
  +        return logKitLogger;
  +    }
   
       LogKit2LoggerTarget( final Logger logger )
       {
  
  
  
  1.3.2.1   +8 -9      jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/PoolableComponentHandler.java
  
  Index: PoolableComponentHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/PoolableComponentHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- PoolableComponentHandler.java	13 May 2002 12:17:41 -0000	1.3
  +++ PoolableComponentHandler.java	18 May 2002 05:13:06 -0000	1.3.2.1
  @@ -15,8 +15,7 @@
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.logger.LogKitLogger;
  -import org.apache.log.Logger;
  +import org.apache.avalon.framework.logger.Logger;
   
   /**
    * The PoolableComponentHandler to make sure that poolable components are initialized
  @@ -82,10 +81,11 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
    * @author <a href="mailto:ryan@silveregg.co.jp">Ryan Shaw</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/05/13 12:17:41 $
  + * @version CVS $Revision: 1.3.2.1 $ $Date: 2002/05/18 05:13:06 $
    * @since 4.0
    */
  -public class PoolableComponentHandler extends ComponentHandler
  +public class PoolableComponentHandler
  +    extends ComponentHandler
   {
       /** The default max size of the pool */
       public static final int DEFAULT_MAX_POOL_SIZE = 8;
  @@ -147,12 +147,11 @@
       /**
        * Sets the logger that the ComponentHandler will use.
        */
  -    public void setLogger( final Logger logger )
  +    public void enableLogging( final Logger logger )
       {
  -        m_factory.setLogger( logger );
  -        m_pool.enableLogging( new LogKitLogger( logger ) );
  -
  -        super.setLogger( logger );
  +        m_factory.enableLogging( logger );
  +        m_pool.enableLogging( logger );
  +        super.enableLogging( logger );
       }
   
       /**
  
  
  
  1.2.2.1   +12 -11    jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ThreadSafeComponentHandler.java
  
  Index: ThreadSafeComponentHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ThreadSafeComponentHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ThreadSafeComponentHandler.java	10 Apr 2002 05:37:27 -0000	1.2
  +++ ThreadSafeComponentHandler.java	18 May 2002 05:13:06 -0000	1.2.2.1
  @@ -14,7 +14,7 @@
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.log.Logger;
  +import org.apache.avalon.framework.logger.Logger;
   
   /**
    * The ThreadSafeComponentHandler to make sure components are initialized
  @@ -23,10 +23,11 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:ryan@silveregg.co.jp">Ryan Shaw</a>
    * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2002/04/10 05:37:27 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2002/05/18 05:13:06 $
    * @since 4.0
    */
  -public class ThreadSafeComponentHandler extends ComponentHandler
  +public class ThreadSafeComponentHandler
  +    extends ComponentHandler
   {
       private Component m_instance;
       private final DefaultComponentFactory m_factory;
  @@ -78,14 +79,14 @@
           m_factory = null;
       }
   
  -    public void setLogger( Logger log )
  +    public void enableLogging( final Logger logger )
       {
  -        if( this.m_factory != null )
  +        if( null != m_factory )
           {
  -            m_factory.setLogger( log );
  +            m_factory.enableLogging( logger );
           }
   
  -        super.setLogger( log );
  +        super.enableLogging( logger );
       }
   
       /**
  @@ -101,18 +102,18 @@
   
           if( m_instance == null )
           {
  -            m_instance = (Component)this.m_factory.newInstance();
  +            m_instance = (Component)m_factory.newInstance();
           }
   
           if( getLogger().isDebugEnabled() )
           {
  -            if( this.m_factory != null )
  +            if( m_factory != null )
               {
  -                getLogger().debug( "ComponentHandler initialized for: " + this.m_factory.getCreatedClass().getName()
);
  +                getLogger().debug( "ComponentHandler initialized for: " + m_factory.getCreatedClass().getName()
);
               }
               else
               {
  -                getLogger().debug( "ComponentHandler initialized for: " + this.m_instance.getClass().getName()
);
  +                getLogger().debug( "ComponentHandler initialized for: " + m_instance.getClass().getName()
);
               }
           }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +2 -2      jakarta-avalon-excalibur/component/src/test/org/apache/avalon/excalibur/component/test/ExcaliburComponentManagerTestCase.java
  
  Index: ExcaliburComponentManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/test/org/apache/avalon/excalibur/component/test/ExcaliburComponentManagerTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- ExcaliburComponentManagerTestCase.java	4 Apr 2002 05:09:02 -0000	1.1
  +++ ExcaliburComponentManagerTestCase.java	18 May 2002 05:13:06 -0000	1.1.2.1
  @@ -37,7 +37,7 @@
    * it is correctly handling component lifestyle management.
    *
    * @author <a href="mailto:ryan@silveregg.co.jp">Ryan Shaw</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.1.2.1 $
    */
   public class ExcaliburComponentManagerTestCase extends TestCase
   {
  @@ -433,7 +433,7 @@
               {new StreamTarget( System.out, new PatternFormatter( pattern ) )} );
           logger.setPriority( Priority.INFO );
   
  -        m_manager.setLogger( logger );
  +        m_manager.enableLogging( new LogKitLogger( logger ) );
           m_manager.contextualize( new DefaultContext() );
           m_manager.configure( new DefaultConfiguration( "", "" ) );
   
  
  
  

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