avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger DefaultLoggerManager.java
Date Mon, 11 Aug 2003 08:39:55 GMT
cziegeler    2003/08/11 01:39:55

  Modified:    logger/src/java/org/apache/avalon/excalibur/logger
                        DefaultLoggerManager.java
  Log:
  Using ContainerUtil were possible
  
  Revision  Changes    Path
  1.7       +26 -13    avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger/DefaultLoggerManager.java
  
  Index: DefaultLoggerManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger/DefaultLoggerManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultLoggerManager.java	27 May 2003 07:30:27 -0000	1.6
  +++ DefaultLoggerManager.java	11 Aug 2003 08:39:55 -0000	1.7
  @@ -53,6 +53,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.container.ContainerUtil;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
  @@ -194,23 +195,26 @@
               }
   
               // now test for some lifecycle interfaces
  -            if( m_loggermanager instanceof LogEnabled )
  +            ContainerUtil.enableLogging(m_loggermanager, m_logger );
  +
  +            try
               {
  -                ( (LogEnabled)m_loggermanager ).enableLogging( m_logger );
  +                ContainerUtil.contextualize( m_loggermanager, m_context );
               }
  -
  -            if( m_loggermanager instanceof Contextualizable )
  +            catch( ContextException ce )
               {
  -                try
  -                {
  -                    ( (Contextualizable)m_loggermanager ).contextualize( m_context );
  -                }
  -                catch( ContextException ce )
  -                {
  -                    throw new ConfigurationException( "Unable to contextualize new logger
manager.", ce );
  -                }
  +                throw new ConfigurationException( "Unable to contextualize new logger manager.",
ce );
               }
   
  +            try 
  +            {
  +                ContainerUtil.service( m_loggermanager, m_manager );
  +            }
  +            catch (ServiceException se ) 
  +            {            
  +                throw new ConfigurationException("Unable to service new logger manager.",
se);
  +            }
  +            
               if( m_loggermanager instanceof Configurable )
               {
                   ( (Configurable)m_loggermanager ).configure( configuration.getChildren()[
0 ] );
  @@ -225,6 +229,15 @@
                   {
                       throw new ConfigurationException( "Unable to parameterize new logger
manager.", pe );
                   }
  +            }
  +
  +            try
  +            {
  +                ContainerUtil.initialize( m_loggermanager );
  +            }
  +            catch (Exception e ) 
  +            {
  +                throw new ConfigurationException("Unable to initialize new logger manager.");
               }
           }
           else
  
  
  

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


Mime
View raw message