[logback-dev] svn commit: r2124 - in logback/trunk: logback-access/src/main/java/ch/qos/logback/access/jetty logback-access/src/main/java/ch/qos/logback/access/spi logback-access/src/main/java/ch/qos/logback/access/tomcat logback-core/src/main/java/ch/qos/logback/core logback-core/src/main/java/ch/qos/logback/core/spi

noreply.ceki at qos.ch noreply.ceki at qos.ch
Fri Jan 9 19:11:38 CET 2009


Author: ceki
Date: Fri Jan  9 19:11:38 2009
New Revision: 2124

Modified:
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/UnsynchronizedAppenderBase.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachable.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachableImpl.java

Log:
In response to LBCORE-83, added getCopyOfFilterList() method to the FilterAttachable interface.


Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java	Fri Jan  9 19:11:38 2009
@@ -3,6 +3,7 @@
 import java.io.File;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 
 import org.mortbay.jetty.Request;
 import org.mortbay.jetty.RequestLog;
@@ -226,6 +227,10 @@
     fai.clearAllFilters();
   }
 
+  public List<Filter<AccessEvent>> getCopyOfFilterList() {
+    return fai.getCopyOfFilterList();
+  }
+  
   public FilterReply getFilterChainDecision(AccessEvent event) {
     return fai.getFilterChainDecision(event);
   }

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java	Fri Jan  9 19:11:38 2009
@@ -1,6 +1,7 @@
 package ch.qos.logback.access.spi;
 
 import java.util.Iterator;
+import java.util.List;
 
 import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.ContextBase;
@@ -63,6 +64,10 @@
     fai.clearAllFilters();
   }
 
+  public List<Filter<AccessEvent>> getCopyOfFilterList() {
+    return fai.getCopyOfFilterList();
+  }
+  
   public FilterReply getFilterChainDecision(AccessEvent event) {
     return fai.getFilterChainDecision(event);
   }

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java	Fri Jan  9 19:11:38 2009
@@ -4,6 +4,7 @@
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import javax.servlet.ServletContext;
@@ -228,6 +229,10 @@
     fai.clearAllFilters();
   }
 
+  public List<Filter<AccessEvent>> getCopyOfFilterList() {
+    return fai.getCopyOfFilterList();
+  }
+  
   public FilterReply getFilterChainDecision(AccessEvent event) {
     return fai.getFilterChainDecision(event);
   }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/AppenderBase.java	Fri Jan  9 19:11:38 2009
@@ -9,6 +9,8 @@
  */
 package ch.qos.logback.core;
 
+import java.util.List;
+
 import ch.qos.logback.core.filter.Filter;
 import ch.qos.logback.core.spi.ContextAwareBase;
 import ch.qos.logback.core.spi.FilterAttachableImpl;
@@ -124,6 +126,10 @@
     fai.clearAllFilters();
   }
 
+  public List<Filter<E>> getCopyOfFilterList() {
+    return fai.getCopyOfFilterList();
+  }
+  
   public FilterReply getFilterChainDecision(E event) {
     return fai.getFilterChainDecision(event);
   }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/UnsynchronizedAppenderBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/UnsynchronizedAppenderBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/UnsynchronizedAppenderBase.java	Fri Jan  9 19:11:38 2009
@@ -9,6 +9,8 @@
  */
 package ch.qos.logback.core;
 
+import java.util.List;
+
 import ch.qos.logback.core.filter.Filter;
 import ch.qos.logback.core.spi.ContextAwareBase;
 import ch.qos.logback.core.spi.FilterAttachableImpl;
@@ -130,6 +132,11 @@
     fai.clearAllFilters();
   }
 
+  public List<Filter<E>> getCopyOfFilterList() {
+    return fai.getCopyOfFilterList();
+  }
+
+  
   public FilterReply getFilterChainDecision(E event) {
     return fai.getFilterChainDecision(event);
   }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachable.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachable.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachable.java	Fri Jan  9 19:11:38 2009
@@ -9,6 +9,8 @@
  */
 package ch.qos.logback.core.spi;
 
+import java.util.List;
+
 import ch.qos.logback.core.filter.Filter;
 
 /**
@@ -26,13 +28,21 @@
    * Get first filter in the chain.
    */
   public Filter getFirstFilter();
-  
+
   public void clearAllFilters();
 
   /**
-   * Loop through the filters in the chain. As soon as a filter decides on 
+   * Get a copy of all the filters contained within this FilterAttachable
+   * object.
+   * 
+   * @return all attached filters as a list
+   */
+  public List<Filter<E>> getCopyOfFilterList();
+
+  /**
+   * Loop through the filters in the chain. As soon as a filter decides on
    * ACCEPT or DENY, then that value is returned. If all of the filters return
-   * NEUTRAL, then  NEUTRAL is returned.
+   * NEUTRAL, then NEUTRAL is returned.
    */
   public FilterReply getFilterChainDecision(E event);
 }

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachableImpl.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachableImpl.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/spi/FilterAttachableImpl.java	Fri Jan  9 19:11:38 2009
@@ -9,6 +9,8 @@
  */
 package ch.qos.logback.core.spi;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import ch.qos.logback.core.filter.Filter;
@@ -61,4 +63,8 @@
     }
     return FilterReply.NEUTRAL;
   }
+
+  public List<Filter<E>> getCopyOfFilterList() {
+    return new ArrayList<Filter<E>>(filterList);
+  }
 }


More information about the logback-dev mailing list