avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger DefaultLogTargetFactoryManager.java
Date Wed, 04 Jun 2003 22:14:57 GMT
donaldp     2003/06/04 15:14:57

  Modified:    logger/src/java/org/apache/avalon/excalibur/logger
                        DefaultLogTargetFactoryManager.java
  Log:
  Support passing in ClassLoader under ClassLoader.class.getName() key
  
  Submitted By: Anton Tagunov <atagunov@mail.cnt.ru>
  
  Revision  Changes    Path
  1.13      +10 -10    avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger/DefaultLogTargetFactoryManager.java
  
  Index: DefaultLogTargetFactoryManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/logger/src/java/org/apache/avalon/excalibur/logger/DefaultLogTargetFactoryManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultLogTargetFactoryManager.java	2 Jun 2003 13:53:33 -0000	1.12
  +++ DefaultLogTargetFactoryManager.java	4 Jun 2003 22:14:56 -0000	1.13
  @@ -112,11 +112,18 @@
           m_context = context;
           try
           {
  -            m_classLoader = (ClassLoader)m_context.get( "classloader" );
  +            m_classLoader = (ClassLoader)m_context.get( ClassLoader.class.getName() );
           }
           catch( ContextException ce )
           {
  -            m_classLoader = Thread.currentThread().getContextClassLoader();
  +            try
  +            {
  +                m_classLoader = (ClassLoader)m_context.get( "classloader" );
  +            }
  +            catch( ContextException e )
  +            {
  +                m_classLoader = Thread.currentThread().getContextClassLoader();
  +            }
           }
       }
   
  @@ -139,18 +146,11 @@
               try
               {
                   Class clazz = null;
  -
  -                //First lets try the supplied ClassLoader
                   try
                   {
                       clazz = m_classLoader.loadClass( factoryClass );
                   }
                   catch( final ClassNotFoundException cnfe )
  -                {
  -                }
  -
  -                //Okay now lets try classLoader this class was loaded from
  -                if( null == clazz )
                   {
                       clazz = getClass().getClassLoader().loadClass( factoryClass );
                   }
  
  
  

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


Mime
View raw message