logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re[2]: cvs commit: jakarta-log4j-sandbox/src/java/org/apache/log4j/selector ContextClassLoaderSelector.java
Date Sat, 15 Feb 2003 15:33:42 GMT

The promised patches are included as attachments.

Please also note the page http://qos.ch/containers/sc.html moved to 
http://qos.ch/logging/sc.html


At 16:08 15.02.2003 +0100, you wrote:

>Hi Jake,
>
>Nothing prevents you from instantiating a ContextClassLoaderSelector 
>instance in InitContextListener. I'll supply the patch in the next few minutes.
>
>At 11:03 14.02.2003 -0600, you wrote:
>>Hello Ceki,
>>
>>No, I haven't as of yet.  I'll try that this weekend.
>>
>>BTW, before you mentioned that doIdempotentInitialization() should be
>>moved from the ContextClassLoaderSelector to whatever code that is
>>performing initializatiion, such as the InitContextListener.  However,
>>I don't see how this is possible given the contents of the
>>initialization method...
>>
>>     public static void doIdempotentInitialization() {
>>         if (!initialized) {
>>             try {
>>                 Object guard = new Object();
>>                 LogManager.setRepositorySelector(SINGLETON, guard);
>>                 initialized = true;
>>             } catch (IllegalArgumentException iae) {
>>                 // either ignore the exception or log the fact that the
>>                 // setting of this custom repository selector failed because
>>                 // another had been set previously and maybe we should set
>>                 // "initialized" to "true" in here so this exception doesn't
>>                 // occur again in this class
>>             }
>>         }
>>     }
>>
>>Note the "SINGLETON" variable sent into setRepositorySelector.  This
>>is a private variable that is the singleton instance of the
>>ContextClassLoader...
>>
>>     /**
>>      * singleton instance for this class
>>      */
>>     private static final ContextClassLoaderSelector SINGLETON =
>>         new ContextClassLoaderSelector();
>>
>
>--
>Ceki 
Mime
View raw message