CAMEL-6609 removed the referece of client
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5404458c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5404458c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5404458c Branch: refs/heads/camel-2.10.x Commit: 5404458c35c66fde1236ac82a5db1d09faa790a3 Parents: a640a20 Author: Willem Jiang <ningji...@apache.org> Authored: Tue Aug 6 11:31:01 2013 +0800 Committer: Willem Jiang <ningji...@apache.org> Committed: Tue Aug 6 19:25:27 2013 +0800 ---------------------------------------------------------------------- .../camel/component/cxf/CxfClientCallback.java | 19 +++++-------------- .../apache/camel/component/cxf/CxfProducer.java | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/5404458c/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java index a6f936f..b33d0b9 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java @@ -20,9 +20,8 @@ import java.util.Map; import org.apache.camel.AsyncCallback; import org.apache.camel.Exchange; -import org.apache.cxf.endpoint.Client; import org.apache.cxf.endpoint.ClientCallback; -import org.apache.cxf.endpoint.ClientImpl; +import org.apache.cxf.endpoint.ConduitSelector; import org.apache.cxf.service.model.BindingOperationInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,17 +34,9 @@ public class CxfClientCallback extends ClientCallback { private final org.apache.cxf.message.Exchange cxfExchange; private final BindingOperationInfo boi; private final CxfBinding binding; - private final Client client; - public CxfClientCallback(AsyncCallback callback, - Exchange camelExchange, - org.apache.cxf.message.Exchange cxfExchange, - BindingOperationInfo boi, - CxfBinding binding) { - this(null, callback, camelExchange, cxfExchange, boi, binding); - } - public CxfClientCallback(Client client, AsyncCallback callback, + public CxfClientCallback(AsyncCallback callback, Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange, BindingOperationInfo boi, @@ -53,7 +44,6 @@ public class CxfClientCallback extends ClientCallback { this.camelAsyncCallback = callback; this.camelExchange = camelExchange; this.cxfExchange = cxfExchange; - this.client = client; this.boi = boi; this.binding = binding; } @@ -82,8 +72,9 @@ public class CxfClientCallback extends ClientCallback { try { super.handleException(ctx, ex); // need to call the conduitSelector complete method to enable the fail over feature - if (client instanceof ClientImpl) { - ((ClientImpl)client).getConduitSelector().complete(cxfExchange); + ConduitSelector conduitSelector = cxfExchange.get(ConduitSelector.class); + if (conduitSelector != null) { + conduitSelector.complete(cxfExchange); ex = cxfExchange.getOutMessage().getContent(Exception.class); if (ex == null && cxfExchange.getInMessage() != null) { ex = cxfExchange.getInMessage().getContent(Exception.class); http://git-wip-us.apache.org/repos/asf/camel/blob/5404458c/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java index dbbe264..28b5d12 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java @@ -106,7 +106,7 @@ public class CxfProducer extends DefaultProducer implements AsyncProcessor { invocationContext.put(Client.RESPONSE_CONTEXT, responseContext); invocationContext.put(Client.REQUEST_CONTEXT, prepareRequest(camelExchange, cxfExchange)); - CxfClientCallback cxfClientCallback = new CxfClientCallback(client, callback, camelExchange, cxfExchange, boi, + CxfClientCallback cxfClientCallback = new CxfClientCallback(callback, camelExchange, cxfExchange, boi, endpoint.getCxfBinding()); // send the CXF async request client.invoke(cxfClientCallback, boi, getParams(endpoint, camelExchange),