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 08:50:37 UTC

svn commit: r725611 - in /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src: main/java/org/apache/servicemix/cxfbc/ test/resources/org/apache/servicemix/cxfbc/

Author: ffang
Date: Wed Dec 10 23:50:37 2008
New Revision: 725611

URL: http://svn.apache.org/viewvc?rev=725611&view=rev
Log:
[SM-1725]Add features support from cxf to the smx-cxf-bc endpoint

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=725611&r1=725610&r2=725611&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java Wed Dec 10 23:50:37 2008
@@ -64,6 +64,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;
@@ -154,6 +155,8 @@
 
     private EndpointInfo ei;
     
+    private List<AbstractFeature> features = new CopyOnWriteArrayList<AbstractFeature>();
+    
     
     /**
      * @return the wsdl
@@ -294,8 +297,17 @@
     public void start() throws Exception {
         super.start();
         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) {
@@ -948,4 +960,12 @@
         return synchronous;
     }
 
+    public void setFeatures(List<AbstractFeature> features) {
+        this.features = features;
+    }
+
+    public List<AbstractFeature> getFeatures() {
+        return features;
+    }
+
 }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=725611&r1=725610&r2=725611&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java Wed Dec 10 23:50:37 2008
@@ -54,8 +54,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.helpers.CastUtils;
 import org.apache.cxf.interceptor.AttachmentOutInterceptor;
 import org.apache.cxf.interceptor.Fault;
@@ -134,6 +137,8 @@
     private boolean useSOAPEnvelope = true;
 
     private boolean synchronous = true;
+    
+    private List<AbstractFeature> features = new CopyOnWriteArrayList<AbstractFeature>();
 
     public void processExchange(MessageExchange exchange) {
 
@@ -521,10 +526,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) {
@@ -657,4 +672,12 @@
         return synchronous;
     }
 
+    public void setFeatures(List<AbstractFeature> features) {
+        this.features = features;
+    }
+
+    public List<AbstractFeature> getFeatures() {
+        return features;
+    }
+
 }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml?rev=725611&r1=725610&r2=725611&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/jms_transport.xml Wed Dec 10 23:50:37 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,37 @@
           <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>