Author: ningjiang
Date: Tue Apr 8 18:20:03 2008
New Revision: 646168
URL: http://svn.apache.org/viewvc?rev=646168&view=rev
Log:
CAMEL-455 Upgraded CXF version from 2.0.4 to 2.0.5, also changed CxfBinding to
the static helper class
Modified:
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
activemq/camel/trunk/pom.xml
Modified:
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java?rev=646168&r1=646167&r2=646168&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
(original)
+++
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBinding.java
Tue Apr 8 18:20:03 2008
@@ -27,7 +27,10 @@
*
* @version $Revision$
*/
-public class CxfBinding {
+public final class CxfBinding {
+ private CxfBinding() {
+ // Helper class
+ }
public static Object extractBodyFromCxf(CxfExchange exchange, Message
message) {
// TODO how do we choose a format?
return getBody(message);
@@ -46,7 +49,7 @@
return null;
}
- public Message createCxfMessage(CxfExchange exchange) {
+ public static Message createCxfMessage(CxfExchange exchange) {
Message answer = exchange.getInMessage();
// CXF uses StAX which is based on the stream API to parse the XML,
@@ -75,7 +78,7 @@
}
- public void storeCxfResponse(CxfExchange exchange, Message response) {
+ public static void storeCxfResponse(CxfExchange exchange, Message
response) {
// no need to process headers as we use the CXF message
CxfMessage out = exchange.getOut();
if (response != null) {
@@ -84,14 +87,14 @@
}
}
- public void storeCxfResponse(CxfExchange exchange, Object response) {
+ public static void storeCxfResponse(CxfExchange exchange, Object response)
{
CxfMessage out = exchange.getOut();
if (response != null) {
out.setBody(response);
}
}
- public void storeCxfFault(CxfExchange exchange, Message message) {
+ public static void storeCxfFault(CxfExchange exchange, Message message) {
CxfMessage fault = exchange.getFault();
if (fault != null) {
fault.setBody(getBody(message));
Modified:
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=646168&r1=646167&r2=646168&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
(original)
+++
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
Tue Apr 8 18:20:03 2008
@@ -135,17 +135,6 @@
return serviceName;
}
- public CxfBinding getBinding() {
- if (binding == null) {
- binding = new CxfBinding();
- }
- return binding;
- }
-
- public void setBinding(CxfBinding binding) {
- this.binding = binding;
- }
-
public boolean isInOut() {
return inOut;
}
Modified:
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?rev=646168&r1=646167&r2=646168&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
(original)
+++
activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
Tue Apr 8 18:20:03 2008
@@ -171,8 +171,7 @@
}
public void process(CxfExchange exchange) {
- CxfBinding cxfBinding = endpoint.getBinding();
- Message inMessage = cxfBinding.createCxfMessage(exchange);
+ Message inMessage = CxfBinding.createCxfMessage(exchange);
try {
if (dataFormat.equals(DataFormat.POJO)) {
// InputStream is = m.getContent(InputStream.class);
@@ -195,10 +194,10 @@
result = client.invoke(operation,
parameters.toArray());
}
response.setContent(Object[].class, result);
- cxfBinding.storeCxfResponse(exchange, response);
+ CxfBinding.storeCxfResponse(exchange, response);
} catch (Exception ex) {
response.setContent(Exception.class, ex);
- cxfBinding.storeCxfFault(exchange, response);
+ CxfBinding.storeCxfFault(exchange, response);
}
} else {
throw new RuntimeCamelException("Can't find the operation
name in the message!");
@@ -248,10 +247,10 @@
invokingContext.setResponseContent(response, result);
// copy the response context to the response
response.putAll(responseContext);
- cxfBinding.storeCxfResponse(exchange, response);
+ CxfBinding.storeCxfResponse(exchange, response);
} catch (Exception e) {
response.setContent(Exception.class, e);
- cxfBinding.storeCxfFault(exchange, response);
+ CxfBinding.storeCxfFault(exchange, response);
}
}
} catch (Exception e) {
Modified: activemq/camel/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/pom.xml?rev=646168&r1=646167&r2=646168&view=diff
==============================================================================
--- activemq/camel/trunk/pom.xml (original)
+++ activemq/camel/trunk/pom.xml Tue Apr 8 18:20:03 2008
@@ -37,7 +37,7 @@
<activemq-version>5.0.0</activemq-version>
<commons-io-version>1.3.1</commons-io-version>
<compiler.fork>false</compiler.fork>
- <cxf-version>2.0.4-incubator</cxf-version>
+ <cxf-version>2.0.5-incubator</cxf-version>
<felix-version>1.4.0</felix-version>
<geronimo-spec-version>1.1</geronimo-spec-version>
<httpcore-version>4.0-alpha6</httpcore-version>