cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r832012 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
Date Mon, 02 Nov 2009 18:31:49 GMT
Author: dkulp
Date: Mon Nov  2 18:31:48 2009
New Revision: 832012

URL: http://svn.apache.org/viewvc?rev=832012&view=rev
Log:
[CXF-920] Add some sys props to enable logging

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=832012&r1=832011&r2=832012&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Mon Nov  2 18:31:48
2009
@@ -22,6 +22,7 @@
 import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
@@ -29,10 +30,25 @@
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.configuration.ConfiguredBeanLocator;
 import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.LoggingFeature;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
 
 @NoJSR250Annotations
-public class CXFBusImpl extends AbstractBasicInterceptorProvider implements Bus {    
+public class CXFBusImpl extends AbstractBasicInterceptorProvider implements Bus {
+    static final boolean FORCE_LOGGING;
+    static {
+        boolean b = false;
+        try {
+            b = Boolean.getBoolean("org.apache.cxf.logging.enabled");
+            //treat these all the same
+            b |= Boolean.getBoolean("com.sun.xml.ws.transport.local.LocalTransportPipe.dump");
+            b |= Boolean.getBoolean("com.sun.xml.ws.util.pipe.StandaloneTubeAssembler.dump");
+            b |= Boolean.getBoolean("com.sun.xml.ws.transport.http.HttpAdapter.dump");
+        } catch (Throwable t) {
+            //ignore
+        }
+        FORCE_LOGGING = b;
+    }
     
     protected final Map<Class, Object> extensions;
     private String id;
@@ -55,6 +71,10 @@
         state = BusState.INITIAL;
         
         CXFBusFactory.possiblySetDefaultBus(this);
+        if (FORCE_LOGGING) {
+            features = new CopyOnWriteArrayList<AbstractFeature>();
+            features.add(new LoggingFeature());
+        }
     }
 
     protected void setState(BusState state) {
@@ -151,8 +171,10 @@
     }
 
     public synchronized void setFeatures(Collection<AbstractFeature> features) {
-        this.features = features;
-        
+        this.features = new CopyOnWriteArrayList<AbstractFeature>(features);
+        if (FORCE_LOGGING) {
+            this.features.add(new LoggingFeature());
+        }
         if (state == BusState.RUNNING) {
             initializeFeatures();
         }



Mime
View raw message