You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2008/12/11 10:04:30 UTC
svn commit: r725626 - in
/servicemix/components/bindings/servicemix-cxf-bc/trunk/src:
main/java/org/apache/servicemix/cxfbc/
test/resources/org/apache/servicemix/cxfbc/
Author: ffang
Date: Thu Dec 11 01:04:29 2008
New Revision: 725626
URL: http://svn.apache.org/viewvc?rev=725626&view=rev
Log:
[SM-1725]Add features support from cxf to the smx-cxf-bc endpoint
Modified:
servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml
Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=725626&r1=725625&r2=725626&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java (original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java Thu Dec 11 01:04:29 2008
@@ -67,6 +67,7 @@
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.endpoint.ServerImpl;
import org.apache.cxf.endpoint.ServerRegistry;
+import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.interceptor.AttachmentInInterceptor;
import org.apache.cxf.interceptor.AttachmentOutInterceptor;
@@ -162,6 +163,8 @@
private EndpointInfo ei;
private boolean started;
+
+ private List<AbstractFeature> features = new CopyOnWriteArrayList<AbstractFeature>();
/**
* @return the wsdl
@@ -285,9 +288,20 @@
public void activate() throws Exception {
super.activate();
registerListServiceHandler();
+ applyFeatures();
server.start();
}
+ private void applyFeatures() {
+ if (getFeatures() != null) {
+ for (AbstractFeature feature : getFeatures()) {
+ feature.initialize(server, getBus());
+ }
+ }
+ }
+
+
+
private void registerListServiceHandler() {
if (server.getDestination() instanceof JettyHTTPDestination) {
JettyHTTPDestination jettyDest = (JettyHTTPDestination) server.getDestination();
@@ -916,5 +930,19 @@
public boolean isSynchronous() {
return synchronous;
}
+
+ /**
+ * Specifies the cxf features set for this endpoint
+ *
+ * @param features a list of <code>AbstractFeature</code> objects
+ * @org.apache.xbean.Property description="Specifies the cxf features set for this endpoint"
+ **/
+ public void setFeatures(List<AbstractFeature> features) {
+ this.features = features;
+ }
+
+ public List<AbstractFeature> getFeatures() {
+ return features;
+ }
}
Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=725626&r1=725625&r2=725626&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java (original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java Thu Dec 11 01:04:29 2008
@@ -58,8 +58,11 @@
import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.interceptor.AttachmentOutInterceptor;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.interceptor.Interceptor;
@@ -137,6 +140,8 @@
private boolean useSOAPEnvelope = true;
private boolean synchronous = true;
+
+ private List<AbstractFeature> features = new CopyOnWriteArrayList<AbstractFeature>();
public void processExchange(MessageExchange exchange) {
@@ -484,10 +489,20 @@
@Override
public void start() throws Exception {
+ applyFeatures();
super.start();
}
+ private void applyFeatures() {
+ Client client = new ClientImpl(getBus(), ep, conduit);
+ if (getFeatures() != null) {
+ for (AbstractFeature feature : getFeatures()) {
+ feature.initialize(client, getBus());
+ }
+ }
+ }
+
protected Bus getBus() {
if (getBusCfg() != null) {
if (bus == null) {
@@ -609,4 +624,20 @@
public boolean isSynchronous() {
return synchronous;
}
+
+ /**
+ * Specifies the cxf features set for this endpoint
+ *
+ * @param features a list of <code>AbstractFeature</code> objects
+ * @org.apache.xbean.Property description="Specifies the cxf features set for this endpoint"
+ **/
+ public void setFeatures(List<AbstractFeature> features) {
+ this.features = features;
+ }
+
+
+ public List<AbstractFeature> getFeatures() {
+ return features;
+ }
+
}
Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml?rev=725626&r1=725625&r2=725626&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml (original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml Thu Dec 11 01:04:29 2008
@@ -27,23 +27,6 @@
<sm:container id="jbi" embedded="true">
<sm:endpoints>
- <!--cxfse:endpoint>
- <cxfse:pojo>
- <bean class="org.apache.servicemix.cxfbc.GreeterImplTwoWayJMS" />
- </cxfse:pojo>
- <cxfse:inInterceptors>
- <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
- </cxfse:inInterceptors>
- <cxfse:outInterceptors>
- <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
- </cxfse:outInterceptors>
- <cxfse:inFaultInterceptors>
- <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
- </cxfse:inFaultInterceptors>
- <cxfse:outFaultInterceptors>
- <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
- </cxfse:outFaultInterceptors>
- </cxfse:endpoint-->
<cxfbc:consumer wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
service="greeter:HelloWorldService"
endpoint="HelloWorldPort"
@@ -63,6 +46,26 @@
<cxfbc:outFaultInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</cxfbc:outFaultInterceptors>
+ <cxfbc:features>
+ <bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
+ <property name="jmsConfig">
+ <bean class="org.apache.cxf.transport.jms.JMSConfiguration">
+ <property name="concurrentConsumers">
+ <value>5</value>
+ </property>
+ <property name="connectionFactory">
+ <ref bean="myConnectionFactory" />
+ </property>
+ <property name="targetDestination">
+ <value>test.jmstransport.text</value>
+ </property>
+ <property name="useJms11">
+ <value>false</value>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </cxfbc:features>
</cxfbc:consumer>
<cxfbc:provider wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
service="greeter:HelloWorldService"
@@ -82,9 +85,36 @@
<cxfbc:outFaultInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</cxfbc:outFaultInterceptors>
+ <cxfbc:features>
+ <bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
+ <property name="jmsConfig">
+ <bean class="org.apache.cxf.transport.jms.JMSConfiguration">
+ <property name="concurrentConsumers">
+ <value>5</value>
+ </property>
+ <property name="connectionFactory">
+ <ref bean="myConnectionFactory" />
+ </property>
+ <property name="targetDestination">
+ <value>test.jmstransport.text.provider</value>
+ </property>
+ <property name="useJms11">
+ <value>false</value>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </cxfbc:features>
+
</cxfbc:provider>
</sm:endpoints>
</sm:container>
-
+ <bean id="myConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory102">
+ <property name="targetConnectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61616" />
+ </bean>
+ </property>
+ </bean>
</beans>