servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1129486 - in /servicemix/components/trunk/engines/servicemix-cxf-se/src: main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java test/resources/org/apache/servicemix/cxfse/spring.xml
Date Tue, 31 May 2011 04:52:00 GMT
Author: ffang
Date: Tue May 31 04:52:00 2011
New Revision: 1129486

URL: http://svn.apache.org/viewvc?rev=1129486&view=rev
Log:
[SMXCOMP-879]cxf se endpoint should support configure JAXBDataBinding with extraClass

Modified:
    servicemix/components/trunk/engines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
    servicemix/components/trunk/engines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml

Modified: servicemix/components/trunk/engines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?rev=1129486&r1=1129485&r2=1129486&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
(original)
+++ servicemix/components/trunk/engines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
Tue May 31 04:52:00 2011
@@ -50,11 +50,13 @@ import org.apache.cxf.aegis.databinding.
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
+import org.apache.cxf.databinding.AbstractDataBinding;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.jaxws.ServiceImpl;
@@ -122,6 +124,8 @@ public class CxfSeEndpoint extends Provi
 
     private Server soapBindingServer;
     
+    private AbstractDataBinding dataBinding;
+    
     /**
      * Returns the object implementing the endpoint's functionality. It is
      * returned as a generic Java <code>Object</code> that can be cast to the
@@ -261,7 +265,11 @@ public class CxfSeEndpoint extends Provi
             sf = new ServerFactoryBean();
             sf.setServiceBean(getPojo());
             sf.setAddress(address);
-            sf.getServiceFactory().setDataBinding(new AegisDatabinding());
+            if (getDataBinding() != null && getDataBinding() instanceof AegisDatabinding)
{
+                sf.getServiceFactory().setDataBinding(getDataBinding());
+            } else {
+                sf.getServiceFactory().setDataBinding(new AegisDatabinding());
+            }
           
             sf.getServiceFactory().setPopulateFromClass(true);
             sf.setStart(false);
@@ -320,8 +328,17 @@ public class CxfSeEndpoint extends Provi
                 endpoint.setBindingUri(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
             }
             if (isUseXmlBeans()) {
-                endpoint.setDataBinding(new XmlBeansDataBinding());
+                if (getDataBinding() != null && getDataBinding() instanceof XmlBeansDataBinding)
{
+                    endpoint.setDataBinding(getDataBinding());
+                } else {
+                    endpoint.setDataBinding(new XmlBeansDataBinding());
+                }
+            } else {
+                if (getDataBinding() != null && getDataBinding() instanceof JAXBDataBinding)
{
+                    endpoint.setDataBinding(getDataBinding());
+                } 
             }
+            
             endpoint.setInInterceptors(getInInterceptors());
             endpoint.setInFaultInterceptors(getInFaultInterceptors());
             endpoint.setOutInterceptors(getOutInterceptors());
@@ -702,4 +719,19 @@ public class CxfSeEndpoint extends Provi
         return useXmlBeans;
     }
 
+   
+    /**
+     * Specifies dataBinding used by the Endpoint
+     * 
+     * @org.apache.xbean.Property description="Specifies dataBinding used by the Endpoint".
+     */
+    public void setDataBinding(AbstractDataBinding dataBinding) {
+        this.dataBinding = dataBinding;
+    }
+
+   
+    public AbstractDataBinding getDataBinding() {
+        return dataBinding;
+    }
+
 }

Modified: servicemix/components/trunk/engines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml?rev=1129486&r1=1129485&r2=1129486&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml
(original)
+++ servicemix/components/trunk/engines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml
Tue May 31 04:52:00 2011
@@ -34,8 +34,10 @@
         <cxfse:pojo>
           <bean class="org.apache.cxf.calculator.CalculatorImpl">
           </bean>
-              
         </cxfse:pojo>
+        <cxfse:dataBinding>
+          <ref bean="myDataBinding"/>
+        </cxfse:dataBinding>
         <cxfse:inInterceptors>
           <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
         </cxfse:inInterceptors>
@@ -53,4 +55,12 @@
     
   </sm:container>
   
+  <bean id="myDataBinding" class="org.apache.cxf.jaxb.JAXBDataBinding" >
+      <property name="extraClass">
+          <list>
+              <value>java.lang.String</value>
+          </list>
+      </property>
+  </bean>
+ 
 </beans>



Mime
View raw message