avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/datasource DefaultDataSourceSelector.java
Date Fri, 23 Nov 2001 01:20:58 GMT
colus       01/11/22 17:20:58

  Modified:    src/java/org/apache/avalon/cornerstone/blocks/datasource
                        DefaultDataSourceSelector.java
  Log:
  Back to Loggable. JdbcDataSource is Loggable.
  
  Revision  Changes    Path
  1.12      +13 -3     jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/datasource/DefaultDataSourceSelector.java
  
  Index: DefaultDataSourceSelector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/datasource/DefaultDataSourceSelector.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DefaultDataSourceSelector.java	2001/11/09 21:07:54	1.11
  +++ DefaultDataSourceSelector.java	2001/11/23 01:20:58	1.12
  @@ -16,7 +16,10 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
  +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.cornerstone.services.datasource.DataSourceSelector;
   import org.apache.avalon.excalibur.datasource.DataSourceComponent;
   import org.apache.avalon.phoenix.Block;
  @@ -44,7 +47,7 @@
    * @author <a href="mailto:colus@isoft.co.kr">Eung-ju Park</a>
    */
   public class DefaultDataSourceSelector
  -    extends AbstractLogEnabled
  +    extends AbstractLoggable
       implements DataSourceSelector, Block, Configurable, Initializable, Disposable
   {
       private Configuration m_configuration;
  @@ -94,7 +97,14 @@
                   component = (DataSourceComponent)classLoader.loadClass( clazz ).newInstance();
               }
   
  -            setupLogger( component, name );
  +            if ( component instanceof LogEnabled )
  +            {
  +                ((LogEnabled)component).enableLogging( new LogKitLogger( getLogger().getChildLogger(
name ) ) );
  +            }
  +            else if ( component instanceof Loggable )
  +            {
  +                ((Loggable)component).setLogger( getLogger().getChildLogger( name ) );
  +            }
               component.configure( dataSourceConf );
               m_dataSources.put( name, component );
   
  
  
  

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