You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/02/13 13:39:02 UTC
[1/3] git commit: CAMEL-7148 Added the ability to send messages to
several participants with thanks to Denis
Updated Branches:
refs/heads/master 7fe4af53a -> 053112878
CAMEL-7148 Added the ability to send messages to several participants with thanks to Denis
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/05311287
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/05311287
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/05311287
Branch: refs/heads/master
Commit: 0531128785c5a76aae97308491a7bf619e1f8c2a
Parents: f8b6d5b
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Feb 13 20:38:24 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Feb 13 20:38:42 2014 +0800
----------------------------------------------------------------------
.../camel/component/xmpp/XmppComponent.java | 15 ++++++++--
.../component/xmpp/XmppPrivateChatProducer.java | 31 +++++++++++++-------
...outeMultipleProducersSingleConsumerTest.java | 1 +
3 files changed, 33 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/05311287/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java
index 1f0656d..dc0e524 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppComponent.java
@@ -17,6 +17,7 @@
package org.apache.camel.component.xmpp;
import java.net.URI;
+import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
@@ -38,9 +39,10 @@ public class XmppComponent extends DefaultComponent {
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- if (endpointCache.containsKey(uri)) {
+ String cacheKey = extractCacheKeyFromUri(uri);
+ if (endpointCache.containsKey(cacheKey)) {
LOG.debug("Using cached endpoint for URI {}", URISupport.sanitizeUri(uri));
- return endpointCache.get(uri);
+ return endpointCache.get(cacheKey);
}
LOG.debug("Creating new endpoint for URI {}", URISupport.sanitizeUri(uri));
@@ -64,7 +66,7 @@ public class XmppComponent extends DefaultComponent {
}
}
- endpointCache.put(uri, endpoint);
+ endpointCache.put(cacheKey, endpoint);
return endpoint;
}
@@ -75,4 +77,11 @@ public class XmppComponent extends DefaultComponent {
endpointCache.clear();
}
+ private String extractCacheKeyFromUri(String uri) throws URISyntaxException {
+ System.out.println("URI " + uri);
+ URI u = new URI(uri);
+ String result = u.getScheme() + "://" + u.getHost() + u.getPort() + u.getQuery();
+ System.out.println("Result " + result);
+ return result;
+ }
}
http://git-wip-us.apache.org/repos/asf/camel/blob/05311287/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java
index 4098ee4..33644d0 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java
@@ -62,45 +62,54 @@ public class XmppPrivateChatProducer extends DefaultProducer {
throw new RuntimeException("Could not connect to XMPP server.", e);
}
+ String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class);
+ String thread = endpoint.getChatId();
+ if (participant == null) {
+ participant = getParticipant();
+ } else {
+ thread = "Chat:" + participant + ":" + endpoint.getUser();
+ }
+
ChatManager chatManager = connection.getChatManager();
- Chat chat = getOrCreateChat(chatManager);
+ Chat chat = getOrCreateChat(chatManager, participant, thread);
Message message = null;
try {
message = new Message();
- message.setTo(getParticipant());
- message.setThread(endpoint.getChatId());
+
+ message.setTo(participant);
+ message.setThread(thread);
message.setType(Message.Type.normal);
endpoint.getBinding().populateXmppMessage(message, exchange);
if (LOG.isDebugEnabled()) {
- LOG.debug("Sending XMPP message to {} from {} : {}", new Object[]{endpoint.getParticipant(), endpoint.getUser(), message.getBody()});
+ LOG.debug("Sending XMPP message to {} from {} : {}", new Object[]{participant, endpoint.getUser(), message.getBody()});
}
chat.sendMessage(message);
} catch (XMPPException xmppe) {
- throw new RuntimeExchangeException("Could not send XMPP message: to " + endpoint.getParticipant() + " from " + endpoint.getUser() + " : " + message
+ throw new RuntimeExchangeException("Could not send XMPP message: to " + participant + " from " + endpoint.getUser() + " : " + message
+ " to: " + XmppEndpoint.getConnectionMessage(connection), exchange, xmppe);
} catch (Exception e) {
- throw new RuntimeExchangeException("Could not send XMPP message to " + endpoint.getParticipant() + " from " + endpoint.getUser() + " : " + message
+ throw new RuntimeExchangeException("Could not send XMPP message to " + participant + " from " + endpoint.getUser() + " : " + message
+ " to: " + XmppEndpoint.getConnectionMessage(connection), exchange, e);
}
}
- private synchronized Chat getOrCreateChat(ChatManager chatManager) {
+ private synchronized Chat getOrCreateChat(ChatManager chatManager, final String participant, String thread) {
if (LOG.isTraceEnabled()) {
LOG.trace("Looking for existing chat instance with thread ID {}", endpoint.getChatId());
}
- Chat chat = chatManager.getThreadChat(endpoint.getChatId());
+ Chat chat = chatManager.getThreadChat(thread);
if (chat == null) {
if (LOG.isTraceEnabled()) {
- LOG.trace("Creating new chat instance with thread ID {}", endpoint.getChatId());
+ LOG.trace("Creating new chat instance with thread ID {}", thread);
}
- chat = chatManager.createChat(getParticipant(), endpoint.getChatId(), new MessageListener() {
+ chat = chatManager.createChat(participant, thread, new MessageListener() {
public void processMessage(Chat chat, Message message) {
// not here to do conversation
if (LOG.isDebugEnabled()) {
LOG.debug("Received and discarding message from {} : {}"
- , getParticipant(), message.getBody());
+ , participant, message.getBody());
}
}
});
http://git-wip-us.apache.org/repos/asf/camel/blob/05311287/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
index f579898..7bf7da0 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
@@ -58,6 +58,7 @@ public class XmppRouteMultipleProducersSingleConsumerTest extends CamelTestSuppo
.to(getProducer2Uri());
from(getConsumerUri())
+ .removeHeader(XmppConstants.TO)
.to(getConsumerUri());
from(getProducer1Uri())
[2/3] git commit: CAMEL-7194 Added features option to the cxfrs
endpoint
Posted by ni...@apache.org.
CAMEL-7194 Added features option to the cxfrs endpoint
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f8b6d5bd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f8b6d5bd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f8b6d5bd
Branch: refs/heads/master
Commit: f8b6d5bd32df1dd42ec09206f5a2f47994b0f5ed
Parents: 5dfee2b
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Feb 13 14:35:24 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Feb 13 20:38:42 2014 +0800
----------------------------------------------------------------------
.../component/cxf/jaxrs/CxfRsEndpoint.java | 72 ++++++++------------
.../cxf/jaxrs/CxfRsSpringEndpoint.java | 12 ----
.../component/cxf/jaxrs/CxfRsProducerTest.java | 43 ++++++++++--
.../component/cxf/jaxrs/CxfRsSpringProducer.xml | 7 ++
.../CxfRsSpringProducerAddressOverride.xml | 7 ++
5 files changed, 83 insertions(+), 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/f8b6d5bd/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index 0b4c816..9cb0b1d 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -39,6 +39,8 @@ import org.apache.camel.spi.HeaderFilterStrategyAware;
import org.apache.camel.util.ObjectHelper;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
+import org.apache.cxf.feature.Feature;
import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
@@ -89,6 +91,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
private boolean isSetDefaultBus;
+ private List<Feature> features = new ModCountCopyOnWriteArrayList<Feature>();
+
@Deprecated
@@ -188,6 +192,16 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
}
sfb.setResourceClasses(res);
}
+ // let customer to override the default setting of provider
+ if (!getProviders().isEmpty()) {
+ sfb.setProviders(getProviders());
+ }
+ // setup the features
+ if (!getFeatures().isEmpty()) {
+ for (Feature feature: getFeatures()) {
+ sfb.getFeatures().add(feature);
+ }
+ }
sfb.setStart(false);
}
@@ -200,6 +214,14 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
cfb.setResourceClass(getResourceClasses().get(0));
cfb.getServiceFactory().setResourceClasses(getResourceClasses());
}
+ // let customer to override the default setting of provider
+ if (!getProviders().isEmpty()) {
+ cfb.setProviders(getProviders());
+ }
+ // setup the features
+ if (!getFeatures().isEmpty()) {
+ cfb.setFeatures(getFeatures());
+ }
if (isLoggingFeatureEnabled()) {
if (getLoggingSizeLimit() > 0) {
cfb.getFeatures().add(new LoggingFeature(getLoggingSizeLimit()));
@@ -238,29 +260,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
public JAXRSServerFactoryBean createJAXRSServerFactoryBean() {
-
JAXRSServerFactoryBean answer = newJAXRSServerFactoryBean();
setupJAXRSServerFactoryBean(answer);
- // let customer to override the default setting of provider
- if (!getProviders().isEmpty()) {
- answer.setProviders(getProviders());
- }
- if (schemaLocations != null) {
- answer.setSchemaLocations(schemaLocations);
- }
- if (isLoggingFeatureEnabled()) {
- if (getLoggingSizeLimit() > 0) {
- answer.getFeatures().add(new LoggingFeature(getLoggingSizeLimit()));
- } else {
- answer.getFeatures().add(new LoggingFeature());
- }
- }
- if (this.isSkipFaultLogging()) {
- if (answer.getProperties() == null) {
- answer.setProperties(new HashMap<String, Object>());
- }
- answer.getProperties().put(FaultListener.class.getName(), new NullFaultListener());
- }
return answer;
}
@@ -270,29 +271,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
}
public JAXRSClientFactoryBean createJAXRSClientFactoryBean(String address) {
-
JAXRSClientFactoryBean answer = newJAXRSClientFactoryBean();
setupJAXRSClientFactoryBean(answer, address);
- // let customer to override the default setting of provider
- if (!getProviders().isEmpty()) {
- answer.setProviders(getProviders());
- }
- if (schemaLocations != null) {
- answer.setSchemaLocations(schemaLocations);
- }
- if (isLoggingFeatureEnabled()) {
- if (getLoggingSizeLimit() > 0) {
- answer.getFeatures().add(new LoggingFeature(getLoggingSizeLimit()));
- } else {
- answer.getFeatures().add(new LoggingFeature());
- }
- }
- if (this.isSkipFaultLogging()) {
- if (answer.getProperties() == null) {
- answer.setProperties(new HashMap<String, Object>());
- }
- answer.getProperties().put(FaultListener.class.getName(), new NullFaultListener());
- }
return answer;
}
@@ -413,6 +393,14 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
return schemaLocations;
}
+ public List<Feature> getFeatures() {
+ return features;
+ }
+
+ public void setFeatures(List<Feature> features) {
+ this.features = features;
+ }
+
/**
* See documentation of {@link BindingStyle}.
*/
http://git-wip-us.apache.org/repos/asf/camel/blob/f8b6d5bd/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
index 1738215..fa96d3c 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
@@ -53,18 +53,6 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint implements BeanIdAware {
}
@Override
- protected void setupJAXRSServerFactoryBean(JAXRSServerFactoryBean sfb) {
- // Do nothing here
- }
-
- @Override
- protected void setupJAXRSClientFactoryBean(JAXRSClientFactoryBean cfb, String address) {
- cfb.setAddress(address);
- // Need to enable the option of ThreadSafe
- cfb.setThreadSafe(true);
- }
-
- @Override
protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
checkBeanType(bean, JAXRSServerFactoryBean.class);
return (JAXRSServerFactoryBean)bean;
http://git-wip-us.apache.org/repos/asf/camel/blob/f8b6d5bd/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java
index 546f074..8eb6d0d 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java
@@ -33,6 +33,11 @@ import org.apache.camel.component.cxf.common.message.CxfConstants;
import org.apache.camel.component.cxf.jaxrs.testbean.Customer;
import org.apache.camel.test.spring.CamelSpringTestSupport;
import org.apache.camel.util.CastUtils;
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.feature.Feature;
+import org.apache.cxf.interceptor.InterceptorProvider;
import org.junit.Test;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -70,7 +75,7 @@ public class CxfRsProducerTest extends CamelSpringTestSupport {
}
@Test
- public void testGetCostumerWithClientProxyAPI() {
+ public void testGetCustomerWithClientProxyAPI() {
// START SNIPPET: ProxyExample
Exchange exchange = template.send("direct://proxy", new Processor() {
public void process(Exchange exchange) throws Exception {
@@ -101,7 +106,7 @@ public class CxfRsProducerTest extends CamelSpringTestSupport {
}
@Test
- public void testGetCostumersWithClientProxyAPI() {
+ public void testGetCustomersWithClientProxyAPI() {
Exchange exchange = template.send("direct://proxy", new Processor() {
public void process(Exchange exchange) throws Exception {
exchange.setPattern(ExchangePattern.InOut);
@@ -127,7 +132,7 @@ public class CxfRsProducerTest extends CamelSpringTestSupport {
}
@Test
- public void testGetCostumerWithHttpCentralClientAPI() {
+ public void testGetCustomerWithHttpCentralClientAPI() {
// START SNIPPET: HttpExample
Exchange exchange = template.send("direct://http", new Processor() {
public void process(Exchange exchange) throws Exception {
@@ -188,7 +193,7 @@ public class CxfRsProducerTest extends CamelSpringTestSupport {
}
@Test
- public void testGetCustumerWithCxfRsEndpoint() {
+ public void testGetCustomerWithCxfRsEndpoint() {
Exchange exchange
= template.send("cxfrs://http://localhost:" + getPort1() + "/" + getClass().getSimpleName() + "/?httpClientAPI=true", new Processor() {
public void process(Exchange exchange) throws Exception {
@@ -376,5 +381,35 @@ public class CxfRsProducerTest extends CamelSpringTestSupport {
assertNotNull(response);
assertTrue(response.endsWith("<name>Donald Duck</name></Customer>"));
}
+
+ static class TestFeature implements Feature {
+ boolean initialized;
+ @Override
+ public void initialize(InterceptorProvider interceptorProvider, Bus bus) {
+ initialized = true;
+ }
+ @Override
+ public void initialize(Client client, Bus bus) {
+ //Do nothing
+ }
+ @Override
+ public void initialize(Server server, Bus bus) {
+ //Do nothing
+ }
+ @Override
+ public void initialize(Bus bus) {
+ //Do nothing
+ }
+ };
+
+ @Test
+ public void testProducerWithFeature() {
+ TestFeature feature = context().getRegistry().lookupByNameAndType("testFeature", TestFeature.class);
+
+ template.requestBodyAndHeader("cxfrs:http://localhost:" + getPort1() + "/" + getClass().getSimpleName() + "/customerservice/customers/123?features=#myFeatures",
+ null, Exchange.HTTP_METHOD, "GET", String.class);
+
+ assertTrue("The feature should be initialized", feature.initialized);
+ }
}
http://git-wip-us.apache.org/repos/asf/camel/blob/f8b6d5bd/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducer.xml
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducer.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducer.xml
index 4500667..6f8add8 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducer.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducer.xml
@@ -19,8 +19,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+ xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
@@ -59,5 +61,10 @@
</camelContext>
<bean id="myProcessor" class="org.apache.camel.component.cxf.jaxrs.CxfRsProducerTest$JettyProcessor"/>
+ <bean id ="testFeature" class="org.apache.camel.component.cxf.jaxrs.CxfRsProducerTest$TestFeature" />
+
+ <util:list id="myFeatures" >
+ <ref bean="testFeature"/>
+ </util:list>
</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/f8b6d5bd/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducerAddressOverride.xml
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducerAddressOverride.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducerAddressOverride.xml
index f13cd8a..e346ab7 100644
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducerAddressOverride.xml
+++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringProducerAddressOverride.xml
@@ -19,8 +19,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+ xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
@@ -59,5 +61,10 @@
</camelContext>
<bean id="myProcessor" class="org.apache.camel.component.cxf.jaxrs.CxfRsProducerTest$JettyProcessor"/>
+ <bean id ="testFeature" class="org.apache.camel.component.cxf.jaxrs.CxfRsProducerTest$TestFeature" />
+
+ <util:list id="myFeatures" >
+ <ref bean="testFeature"/>
+ </util:list>
</beans>
[3/3] git commit: CAMEL-6783 Updated the Features get/set method with
the change of CXF
Posted by ni...@apache.org.
CAMEL-6783 Updated the Features get/set method with the change of CXF
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5dfee2be
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5dfee2be
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5dfee2be
Branch: refs/heads/master
Commit: 5dfee2be58155ac29cd1540cf9d7d3b10406216e
Parents: 7fe4af5
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Feb 12 21:51:28 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Feb 13 20:38:42 2014 +0800
----------------------------------------------------------------------
.../main/java/org/apache/camel/component/cxf/CxfEndpoint.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5dfee2be/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index 00adf1d..bde547d 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -76,6 +76,7 @@ import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.Feature;
import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.frontend.ClientFactoryBean;
import org.apache.cxf.frontend.ServerFactoryBean;
@@ -146,7 +147,7 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
private List<Interceptor<? extends Message>> out = new ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>();
private List<Interceptor<? extends Message>> outFault = new ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>();
private List<Interceptor<? extends Message>> inFault = new ModCountCopyOnWriteArrayList<Interceptor<? extends Message>>();
- private List<AbstractFeature> features = new ModCountCopyOnWriteArrayList<AbstractFeature>();
+ private List<Feature> features = new ModCountCopyOnWriteArrayList<Feature>();
@SuppressWarnings("rawtypes")
private List<Handler> handlers;
@@ -1092,11 +1093,11 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
outFault = interceptors;
}
- public void setFeatures(List<AbstractFeature> f) {
+ public void setFeatures(List<Feature> f) {
features = f;
}
- public List<AbstractFeature> getFeatures() {
+ public List<Feature> getFeatures() {
return features;
}