Author: ningjiang
Date: Fri Nov 5 01:39:50 2010
New Revision: 1031392
URL: http://svn.apache.org/viewvc?rev=1031392&view=rev
Log:
CAMEL-3310 using CXF 2.3.0 tooling in camel-soap
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
camel/trunk/parent/pom.xml
Modified:
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java?rev=1031392&r1=1031391&r2=1031392&view=diff
==============================================================================
---
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
(original)
+++
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
Fri Nov 5 01:39:50 2010
@@ -75,16 +75,10 @@ public class CxfConsumer extends Default
synchronized (continuation) {
if (continuation.isNew()) {
final org.apache.camel.Exchange camelExchange =
perpareCamelExchange(cxfExchange);
-
- // Now we don't set up the timeout value
- if (LOG.isTraceEnabled()) {
- LOG.trace("Suspending continuation of exchangeId:
" + camelExchange.getExchangeId());
- }
- // The continuation could be called before the suspend
is called
- continuation.suspend(0);
-
+ // TODO we need to use the CXF 2.3.0 new Continuation
API in CAMEL 3.0.0
+ // The below code should work for CXF 2.2.x and CXF
2.3.x at the same time
// use the asynchronous API to process the exchange
- getAsyncProcessor().process(camelExchange, new
AsyncCallback() {
+ boolean sync =
getAsyncProcessor().process(camelExchange, new AsyncCallback() {
public void done(boolean doneSync) {
// make sure the continuation resume will not
be called before the suspend method in other thread
synchronized (continuation) {
@@ -98,7 +92,26 @@ public class CxfConsumer extends Default
}
}
});
-
+ // just need to avoid the continuation.resume is called
+ // before the continuation.suspend is called
+ if (continuation.getObject() != camelExchange &&
!sync) {
+ // Now we don't set up the timeout value
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Suspending continuation of
exchangeId: "
+ + camelExchange.getExchangeId());
+ }
+ // The continuation could be called before the
+ // suspend is called
+ continuation.suspend(0);
+ } else {
+ // just set the response back, as the invoking
+ // thread is not changed
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Processed the Exchange : " +
camelExchange.getExchangeId());
+ }
+ setResponseBack(cxfExchange, camelExchange);
+ }
+
}
if (continuation.isResumed()) {
org.apache.camel.Exchange camelExchange =
(org.apache.camel.Exchange)continuation
Modified: camel/trunk/parent/pom.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1031392&r1=1031391&r2=1031392&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Fri Nov 5 01:39:50 2010
@@ -53,6 +53,7 @@
<commons-pool-version>1.5.4</commons-pool-version>
<commons-dbcp-version>1.3</commons-dbcp-version>
<cxf-version>2.3.0</cxf-version>
+ <cxf-xjc-utils-version>2.3.0</cxf-xjc-utils-version>
<derby-version>10.4.2.0</derby-version>
<dozer-version>5.3.0</dozer-version>
<easymock-version>2.5.2</easymock-version>