cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r941159 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Date Wed, 05 May 2010 06:27:41 GMT
Author: dkulp
Date: Wed May  5 06:27:41 2010
New Revision: 941159

URL: http://svn.apache.org/viewvc?rev=941159&view=rev
Log:
[CXF-2792] Make sure custom set executor gets passed into conduit and
used

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=941159&r1=941158&r2=941159&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Wed May  5 06:27:41
2010
@@ -773,13 +773,20 @@ public class ClientImpl
         if (exchange.isSynchronous() || executor == null) {
             exchange.put(MessageObserver.class, this);
         } else {
+            exchange.put(Executor.class, executor);
             exchange.put(MessageObserver.class, new MessageObserver() {
                 public void onMessage(final Message message) {
-                    executor.execute(new Runnable() {
-                        public void run() {
-                            ClientImpl.this.onMessage(message);
-                        }
-                    });
+                    if (!message.getExchange()
+                        .containsKey(Executor.class.getName() + ".USING_SPECIFIED")) {
+                        
+                        executor.execute(new Runnable() {
+                            public void run() {
+                                ClientImpl.this.onMessage(message);
+                            }
+                        });
+                    } else {
+                        ClientImpl.this.onMessage(message);
+                    }
                 }
             });
         }

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=941159&r1=941158&r2=941159&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Wed May
 5 06:27:41 2010
@@ -459,13 +459,15 @@ public class ServiceImpl extends Service
         configureObject(service);
                 
         // Configure the JaxWsEndpoitnImpl
-        JaxWsEndpointImpl jaxwsEndpoint = (JaxWsEndpointImpl) ClientProxy.getClient(obj).getEndpoint();
+        Client client = ClientProxy.getClient(obj);
+        client.getEndpoint().setExecutor(executor);
+        client.setExecutor(executor);
+        JaxWsEndpointImpl jaxwsEndpoint = (JaxWsEndpointImpl) client.getEndpoint();
         configureObject(jaxwsEndpoint);  
         List<Handler> hc = jaxwsEndpoint.getJaxwsBinding().getHandlerChain();
         
         hc.addAll(handlerResolver.getHandlerChain(portInfos.get(portName)));
         jaxwsEndpoint.getJaxwsBinding().setHandlerChain(hc);
-
         LOG.log(Level.FINE, "created proxy", obj);
 
         ports.add(portName);

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=941159&r1=941158&r2=941159&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Wed May  5 06:27:41 2010
@@ -41,6 +41,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executor;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -78,7 +79,6 @@ import org.apache.cxf.transport.https.Ce
 import org.apache.cxf.transport.https.CertConstraintsJaxBUtils;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
 import org.apache.cxf.version.Version;
-import org.apache.cxf.workqueue.AutomaticWorkQueue;
 import org.apache.cxf.workqueue.WorkQueueManager;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.policy.Assertor;
@@ -2059,13 +2059,19 @@ public class HTTPConduit 
                         }
                     }
                 };
-                WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
-                    .getExtension(WorkQueueManager.class);
-                AutomaticWorkQueue queue = mgr.getNamedWorkQueue("http-conduit");
-                if (queue == null) {
-                    queue = mgr.getAutomaticWorkQueue();
+                Executor ex = outMessage.getExchange().get(Executor.class);
+                if (ex == null) {
+                    WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
+                        .getExtension(WorkQueueManager.class);
+                    ex = mgr.getNamedWorkQueue("http-conduit");
+                    if (ex == null) {
+                        ex = mgr.getAutomaticWorkQueue();
+                    }
+                } else {
+                    outMessage.getExchange().put(Executor.class.getName() 
+                                                 + ".USING_SPECIFIED", Boolean.TRUE);
                 }
-                queue.execute(runnable);
+                ex.execute(runnable);
             }
         }
         protected void handleResponseInternal() throws IOException {



Mime
View raw message