Author: dkulp
Date: Thu Oct 29 14:41:19 2009
New Revision: 830968
URL: http://svn.apache.org/viewvc?rev=830968&view=rev
Log:
[CXF-1282, CXF-1283] Fix a bug where setting an executor may result in a
hang.
Modified:
cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
Modified:
cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java?rev=830968&r1=830967&r2=830968&view=diff
==============================================================================
---
cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
(original)
+++
cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
Thu Oct 29 14:41:19 2009
@@ -93,7 +93,15 @@
invocation.run();
} else {
exchange.put(Executor.class, executor);
- FutureTask<Object> o = new FutureTask<Object>(invocation, null);
+ FutureTask<Object> o = new FutureTask<Object>(invocation, null) {
+ @Override
+ protected void done() {
+ super.done();
+ synchronized (this) {
+ this.notifyAll();
+ }
+ }
+ };
synchronized (o) {
executor.execute(o);
if (!exchange.isOneWay()) {
Modified:
cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?rev=830968&r1=830967&r2=830968&view=diff
==============================================================================
---
cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
(original)
+++
cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
Thu Oct 29 14:41:19 2009
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.concurrent.Executor;
import javax.wsdl.Definition;
import javax.wsdl.factory.WSDLFactory;
@@ -144,6 +145,11 @@
Hello service = new Hello();
EndpointImpl ep = new EndpointImpl(getBus(), service, (String) null);
+ ep.setExecutor(new Executor() {
+ public void execute(Runnable r) {
+ new Thread(r).start();
+ }
+ });
ep.publish("local://localhost:9090/hello");
Node res = invoke("local://localhost:9090/hello",