cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1097729 - in /cxf/trunk/rt: databinding/aegis/src/test/java/org/apache/cxf/aegis/ databinding/jibx/src/test/java/org/apache/cxf/jibx/ databinding/sdo/src/test/java/org/apache/cxf/sdo/ databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbe...
Date Fri, 29 Apr 2011 08:43:53 GMT
Author: ningjiang
Date: Fri Apr 29 08:43:53 2011
New Revision: 1097729

URL: http://svn.apache.org/viewvc?rev=1097729&view=rev
Log:
CXF-3473 Let CXF LocalConduit and LocalDestination handler the request with Executor

Modified:
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
    cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java
    cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java
    cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java
    cxf/trunk/rt/transports/local/src/test/java/org/apache/cxf/transport/local/LocalTransportFactoryTest.java
    cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
Fri Apr 29 08:43:53 2011
@@ -95,7 +95,7 @@ public abstract class AbstractAegisTest 
         dfm.registerDestinationFactory(SoapBindingConstants.SOAP11_BINDING_ID, soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
 
-        localTransport = new LocalTransportFactory();
+        localTransport = new LocalTransportFactory(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java
(original)
+++ cxf/trunk/rt/databinding/jibx/src/test/java/org/apache/cxf/jibx/AbstractJibxTest.java
Fri Apr 29 08:43:53 2011
@@ -60,7 +60,7 @@ public abstract class AbstractJibxTest e
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
 
-        localTransport = new LocalTransportFactory();
+        localTransport = new LocalTransportFactory(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java (original)
+++ cxf/trunk/rt/databinding/sdo/src/test/java/org/apache/cxf/sdo/AbstractSDOTest.java Fri
Apr 29 08:43:53 2011
@@ -78,7 +78,7 @@ public abstract class AbstractSDOTest ex
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
         
-        localTransport = new LocalTransportFactory();
+        localTransport = new LocalTransportFactory(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
(original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
Fri Apr 29 08:43:53 2011
@@ -78,7 +78,7 @@ public abstract class AbstractXmlBeansTe
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
         
-        localTransport = new LocalTransportFactory();
+        localTransport = new LocalTransportFactory(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
Fri Apr 29 08:43:53 2011
@@ -67,7 +67,7 @@ public abstract class AbstractJaxWsTest 
         dfm.registerDestinationFactory(SoapBindingConstants.SOAP12_BINDING_ID, soapDF);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
         
-        localTransport = new LocalTransportFactory();
+        localTransport = new LocalTransportFactory(bus);
         localTransport.setUriPrefixes(new HashSet<String>(Arrays.asList("http", "local")));
         dfm.registerDestinationFactory(LocalTransportFactory.TRANSPORT_ID, localTransport);
         dfm.registerDestinationFactory("http://cxf.apache.org/transports/http", localTransport);

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
Fri Apr 29 08:43:53 2011
@@ -340,7 +340,7 @@ public class ConfiguredEndpointTest exte
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
 
-        LocalTransportFactory localTransport = new LocalTransportFactory();
+        LocalTransportFactory localTransport = new LocalTransportFactory(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
     }

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/AbstractSimpleFrontendTest.java
Fri Apr 29 08:43:53 2011
@@ -47,7 +47,7 @@ public abstract class AbstractSimpleFron
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapTF);
 
-        LocalTransportFactory localTransport = new LocalTransportFactory();
+        LocalTransportFactory localTransport = new LocalTransportFactory(bus);
         localTransport.getUriPrefixes().add("http");
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
(original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
Fri Apr 29 08:43:53 2011
@@ -137,8 +137,11 @@ public class LocalConduit extends Abstra
                             destination.getMessageObserver().onMessage(inMsg);
                         }
                     };
-                    
-                    new Thread(receiver).start();
+                    if (transportFactory.getExecutor() != null) {
+                        transportFactory.getExecutor().execute(receiver);
+                    } else {
+                        new Thread(receiver).start();
+                    }
                 }
             };
         message.setContent(OutputStream.class, cout);

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
(original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
Fri Apr 29 08:43:53 2011
@@ -97,8 +97,11 @@ public class LocalDestination extends Ab
                                     conduit.getMessageObserver().onMessage(m);
                                 }
                             };
-                            
-                            new Thread(receiver).start();
+                            if (localDestinationFactory.getExecutor() != null) {
+                                localDestinationFactory.getExecutor().execute(receiver);
+                            } else {
+                                new Thread(receiver).start();
+                            }
                         }
                     };
                 

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java
(original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java
Fri Apr 29 08:43:53 2011
@@ -26,6 +26,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.Executor;
 import java.util.logging.Logger;
 
 import javax.annotation.Resource;
@@ -41,6 +42,7 @@ import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.workqueue.WorkQueueManager;
 import org.apache.cxf.ws.addressing.AttributedURIType;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
@@ -70,6 +72,7 @@ public class LocalTransportFactory exten
     private Set<String> messageFilterProperties;
     private Set<String> messageIncludeProperties;
     private Set<String> uriPrefixes = new HashSet<String>(URI_PREFIXES);
+    private volatile Executor executor;
 
     public LocalTransportFactory() {
         this(null);
@@ -116,6 +119,24 @@ public class LocalTransportFactory exten
     void remove(LocalDestination destination) {
         destinations.remove(destination);
     }
+    
+    public Executor getExecutor() {
+        if (executor == null && bus != null) {
+            synchronized (this) {
+                if (executor == null) {
+                    WorkQueueManager manager = bus.getExtension(WorkQueueManager.class);
+                    if (manager != null) {
+                        executor =  manager.getAutomaticWorkQueue();
+                    }
+                }
+            }
+        }
+        return executor;
+    }
+    
+    public void setExecutor(Executor executor) {
+        this.executor = executor;
+    }
 
     public Conduit getConduit(EndpointInfo ei) throws IOException {
         return new LocalConduit(this, (LocalDestination)getDestination(ei));

Modified: cxf/trunk/rt/transports/local/src/test/java/org/apache/cxf/transport/local/LocalTransportFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/test/java/org/apache/cxf/transport/local/LocalTransportFactoryTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/test/java/org/apache/cxf/transport/local/LocalTransportFactoryTest.java
(original)
+++ cxf/trunk/rt/transports/local/src/test/java/org/apache/cxf/transport/local/LocalTransportFactoryTest.java
Fri Apr 29 08:43:53 2011
@@ -25,6 +25,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -47,7 +49,9 @@ public class LocalTransportFactoryTest e
     }
     
     private void testInvocation(boolean isDirectDispatch) throws Exception {
-        LocalTransportFactory factory = new LocalTransportFactory();
+        // Need to create a DefaultBus
+        Bus bus = BusFactory.getDefaultBus();
+        LocalTransportFactory factory = new LocalTransportFactory(bus);
         
         EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
         AddressType a = new AddressType();

Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java?rev=1097729&r1=1097728&r2=1097729&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java
(original)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java
Fri Apr 29 08:43:53 2011
@@ -67,7 +67,7 @@ public class PolicyAnnotationTest extend
             "http://cxf.apache.org/transports/http/configuration",
             "http://cxf.apache.org/bindings/xformat");
         
-        LocalTransportFactory f = new LocalTransportFactory();
+        LocalTransportFactory f = new LocalTransportFactory(bus);
         f.getUriPrefixes().add("http");
         f.setTransportIds(tp);
         f.setBus(bus);



Mime
View raw message