[logback-dev] branch, master, updated. 8ef964606da95d04e7ee0297cc25ffca661d265f

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Thu Dec 3 00:00:51 CET 2009


The branch, master has been updated
       via  8ef964606da95d04e7ee0297cc25ffca661d265f (commit)
      from  742e903cdbc5ebe7470f4e8f32fa8ac03bce0b6a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=8ef964606da95d04e7ee0297cc25ffca661d265f
http://github.com/ceki/logback/commit/8ef964606da95d04e7ee0297cc25ffca661d265f

commit 8ef964606da95d04e7ee0297cc25ffca661d265f
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Wed Dec 2 23:59:11 2009 +0100

    cosmetic change in relation to context synchronization

diff --git a/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java b/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
index 9f14412..95347d2 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
@@ -67,6 +67,7 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
       + "logback-access.xml";
   
   private long birthTime = System.currentTimeMillis();
+  Object configurationLock = new Object();
 
   
   // Attributes from ContextBase:
@@ -268,6 +269,10 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
   public long getBithTime() {
     return birthTime;
   }
+
+  public Object getConfigurationLock() {
+    return configurationLock;
+  }
   
   // ====== Methods from catalina Lifecycle =====
 
@@ -283,6 +288,4 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
     // dummy NOP implementation
   }
 
-
-
 }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java b/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
index 1fdbaeb..36ed7af 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/LoggerContext.java
@@ -68,7 +68,7 @@ public class LoggerContext extends ContextBase implements ILoggerFactory,
   boolean started = false;
 
   int resetCount = 0;
-  
+
   public LoggerContext() {
     super();
     this.loggerCache = new Hashtable<String, Logger>();
@@ -170,7 +170,7 @@ public class LoggerContext extends ContextBase implements ILoggerFactory,
    * reference, otherwise returns <code>null</code>.
    * 
    * @param name
-   *                the name of the logger to search for.
+   *          the name of the logger to search for.
    */
   public Logger exists(String name) {
     return (Logger) loggerCache.get(name);
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
index 4bc1f33..ce82a6f 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
@@ -56,7 +56,7 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
     if (url != null) {
       fileToScan = convertToFile(url);
       if (fileToScan != null) {
-        synchronized (context) {
+        synchronized (context.getConfigurationLock()) {
           long inSeconds = refreshPeriod / 1000;
           addInfo("Will scan for changes in file [" + fileToScan + "] every "
               + inSeconds + " seconds. ");
@@ -102,7 +102,7 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
       return FilterReply.NEUTRAL;
     }
 
-    synchronized (context) {
+    synchronized (context.getConfigurationLock()) {
       boolean changed = changeDetected();
       if (changed) {
         addInfo("Detected change in [" + fileToScan + "]");
diff --git a/logback-core/src/main/java/ch/qos/logback/core/Context.java b/logback-core/src/main/java/ch/qos/logback/core/Context.java
index 039c2f9..863896f 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/Context.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/Context.java
@@ -86,4 +86,11 @@ public interface Context extends PropertyContainer {
    * @return The time as measured when this class was created.
    */
   public long getBithTime();
+  
+  /**
+   * Object used for synchronization purposes. 
+   * INTENDED FOR INTERNAL USAGE.
+   */
+  public Object getConfigurationLock();
+
 }
diff --git a/logback-core/src/main/java/ch/qos/logback/core/ContextBase.java b/logback-core/src/main/java/ch/qos/logback/core/ContextBase.java
index 41ac456..5e2fd6e 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/ContextBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/ContextBase.java
@@ -30,6 +30,8 @@ public class ContextBase implements Context {
   Map<String, String> propertyMap = new HashMap<String, String>();
   Map<String, Object> objectMap = new HashMap<String, Object>();
 
+  Object configurationLock = new Object();
+  
   public StatusManager getStatusManager() {
     return sm;
   }
@@ -108,4 +110,8 @@ public class ContextBase implements Context {
   public long getBithTime() {
     return birthTime;
   }
+
+  public Object getConfigurationLock() {
+    return configurationLock;
+  }
 }
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
index 2346adf..80a83cc 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
@@ -122,7 +122,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
     recorder.recordEvents(inputSource);
     buildInterpreter();
     // disallow simultaneous configurations of the same context
-    synchronized (context) {
+    synchronized (context.getConfigurationLock()) {
       interpreter.play(recorder.saxEventList);
     }
   }

-----------------------------------------------------------------------

Summary of changes:
 .../ch/qos/logback/access/tomcat/LogbackValve.java |    7 +++++--
 .../java/ch/qos/logback/classic/LoggerContext.java |    4 ++--
 .../classic/turbo/ReconfigureOnChangeFilter.java   |    4 ++--
 .../src/main/java/ch/qos/logback/core/Context.java |    7 +++++++
 .../main/java/ch/qos/logback/core/ContextBase.java |    6 ++++++
 .../logback/core/joran/GenericConfigurator.java    |    2 +-
 6 files changed, 23 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list