cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r993441 - in /cxf/trunk: distribution/bundle/all/ distribution/bundle/jaxrs/ distribution/bundle/minimal/ rt/databinding/aegis/src/main/resources/META-INF/cxf/ rt/databinding/jaxb/src/main/resources/META-INF/ rt/databinding/jaxb/src/main/re...
Date Tue, 07 Sep 2010 17:30:55 GMT
Author: dkulp
Date: Tue Sep  7 17:30:55 2010
New Revision: 993441

URL: http://svn.apache.org/viewvc?rev=993441&view=rev
Log:
[CXF-2979] Fix issues around plugability of databinding for java2ws
style tools.

Added:
    cxf/trunk/rt/databinding/aegis/src/main/resources/META-INF/cxf/java2wsbeans.xml
      - copied, changed from r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
    cxf/trunk/rt/databinding/jaxb/src/main/resources/META-INF/
    cxf/trunk/rt/databinding/jaxb/src/main/resources/META-INF/cxf/
    cxf/trunk/rt/databinding/jaxb/src/main/resources/META-INF/cxf/java2wsbeans.xml
      - copied, changed from r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
    cxf/trunk/rt/databinding/sdo/src/main/resources/META-INF/cxf/
    cxf/trunk/rt/databinding/sdo/src/main/resources/META-INF/cxf/java2wsbeans.xml
      - copied, changed from r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
    cxf/trunk/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/
    cxf/trunk/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
      - copied, changed from r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
Modified:
    cxf/trunk/distribution/bundle/all/pom.xml
    cxf/trunk/distribution/bundle/jaxrs/pom.xml
    cxf/trunk/distribution/bundle/minimal/pom.xml
    cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DefaultServiceBuilderFactory.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java

Modified: cxf/trunk/distribution/bundle/all/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/bundle/all/pom.xml?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/distribution/bundle/all/pom.xml (original)
+++ cxf/trunk/distribution/bundle/all/pom.xml Tue Sep  7 17:30:55 2010
@@ -382,6 +382,9 @@
                                 <transformer implementation="org.apache.cxf.maven.PluginTransformer">
                                     <resource>META-INF/tools-plugin.xml</resource>
                                 </transformer>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
+                                    <resource>META-INF/cxf/java2wsbeans.xml</resource>
+                                </transformer>
                                 <transformer implementation="org.apache.cxf.maven.CXFAllTransformer"
/>
                             </transformers>
                         </configuration>

Modified: cxf/trunk/distribution/bundle/jaxrs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/bundle/jaxrs/pom.xml?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/distribution/bundle/jaxrs/pom.xml (original)
+++ cxf/trunk/distribution/bundle/jaxrs/pom.xml Tue Sep  7 17:30:55 2010
@@ -222,6 +222,9 @@
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                     <resource>META-INF/cxf/bus-extensions.xml</resource>
                                 </transformer>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
+                                    <resource>META-INF/cxf/java2wsbeans.xml</resource>
+                                </transformer>
                                 <transformer implementation="org.apache.cxf.maven.CXFAllTransformer"
/>
                             </transformers>
                         </configuration>

Modified: cxf/trunk/distribution/bundle/minimal/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/bundle/minimal/pom.xml?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/distribution/bundle/minimal/pom.xml (original)
+++ cxf/trunk/distribution/bundle/minimal/pom.xml Tue Sep  7 17:30:55 2010
@@ -278,6 +278,9 @@
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                                     <resource>META-INF/wsdl.plugin.xml</resource>
                                 </transformer>                     
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
+                                    <resource>META-INF/cxf/java2wsbeans.xml</resource>
+                                </transformer>
                                 <transformer implementation="org.apache.cxf.maven.CXFAllTransformer"
/>
                             </transformers>
                         </configuration>

Copied: cxf/trunk/rt/databinding/aegis/src/main/resources/META-INF/cxf/java2wsbeans.xml (from
r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/resources/META-INF/cxf/java2wsbeans.xml?p2=cxf/trunk/rt/databinding/aegis/src/main/resources/META-INF/cxf/java2wsbeans.xml&p1=cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml&r1=993440&r2=993441&rev=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/resources/META-INF/cxf/java2wsbeans.xml Tue Sep
 7 17:30:55 2010
@@ -22,11 +22,7 @@
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-<bean id='JaxwsServiceBuilderBean' class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype"
/>
-<bean id='SimpleServiceBuilderBean' class='org.apache.cxf.simple.SimpleServiceBuilder'
scope="prototype" />
-
-<bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
-<bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
+    <bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
 
 
 </beans>

Copied: cxf/trunk/rt/databinding/jaxb/src/main/resources/META-INF/cxf/java2wsbeans.xml (from
r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/resources/META-INF/cxf/java2wsbeans.xml?p2=cxf/trunk/rt/databinding/jaxb/src/main/resources/META-INF/cxf/java2wsbeans.xml&p1=cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml&r1=993440&r2=993441&rev=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/resources/META-INF/cxf/java2wsbeans.xml Tue Sep
 7 17:30:55 2010
@@ -22,11 +22,6 @@
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-<bean id='JaxwsServiceBuilderBean' class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype"
/>
-<bean id='SimpleServiceBuilderBean' class='org.apache.cxf.simple.SimpleServiceBuilder'
scope="prototype" />
-
-<bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
-<bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
-
+    <bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
 
 </beans>

Copied: cxf/trunk/rt/databinding/sdo/src/main/resources/META-INF/cxf/java2wsbeans.xml (from
r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/main/resources/META-INF/cxf/java2wsbeans.xml?p2=cxf/trunk/rt/databinding/sdo/src/main/resources/META-INF/cxf/java2wsbeans.xml&p1=cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml&r1=993440&r2=993441&rev=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml (original)
+++ cxf/trunk/rt/databinding/sdo/src/main/resources/META-INF/cxf/java2wsbeans.xml Tue Sep
 7 17:30:55 2010
@@ -22,11 +22,6 @@
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-<bean id='JaxwsServiceBuilderBean' class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype"
/>
-<bean id='SimpleServiceBuilderBean' class='org.apache.cxf.simple.SimpleServiceBuilder'
scope="prototype" />
-
-<bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
-<bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
-
+    <bean id='SdoDatabindingBean' class="org.apache.cxf.sdo.SDODataBinding" scope="prototype"
/>
 
 </beans>

Copied: cxf/trunk/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
(from r993440, cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml?p2=cxf/trunk/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml&p1=cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml&r1=993440&r2=993441&rev=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml (original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml Tue
Sep  7 17:30:55 2010
@@ -22,11 +22,6 @@
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-<bean id='JaxwsServiceBuilderBean' class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype"
/>
-<bean id='SimpleServiceBuilderBean' class='org.apache.cxf.simple.SimpleServiceBuilder'
scope="prototype" />
-
-<bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
-<bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
-
+    <bean id='XmlbeansDatabindingBean' class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"
scope="prototype" />
 
 </beans>

Modified: cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml (original)
+++ cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml Tue Sep  7 17:30:55
2010
@@ -25,8 +25,5 @@ http://www.springframework.org/schema/be
 <bean id='JaxwsServiceBuilderBean' class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype"
/>
 <bean id='SimpleServiceBuilderBean' class='org.apache.cxf.simple.SimpleServiceBuilder'
scope="prototype" />
 
-<bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
-<bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
-
 
 </beans>

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
Tue Sep  7 17:30:55 2010
@@ -131,7 +131,11 @@ public class JavaToJSProcessor implement
                 }
             }
         }
-        ServiceBuilderFactory builderFactory = ServiceBuilderFactory.getInstance(beanDefinitions);
+
+        
+        ServiceBuilderFactory builderFactory 
+            = ServiceBuilderFactory.getInstance(beanDefinitions,
+                                                getDataBindingName());
         Class<?> clz = getServiceClass();
         context.put(Class.class, clz);
         if (clz.isInterface()) {

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml (original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml Tue Sep
 7 17:30:55 2010
@@ -38,12 +38,12 @@
 		
 			<option id="databinding" maxOccurs="1">
 				<annotation>
-				    Specify the data binding (aegis or jaxb). Default is jaxb for jaxws 
+				    Specify the data binding (aegis, jaxb, xmlbeans, etc...). Default is jaxb for jaxws

 				    frontend, and aegis for simple frontend.
 				</annotation>
 				<switch>databinding</switch>
 				<associatedArgument placement="afterSpace">
-				  <annotation>jaxb or aegis</annotation>
+				  <annotation>databinding name</annotation>
 				</associatedArgument>
 			</option>
 			<option id="frontend" maxOccurs="1">

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
Tue Sep  7 17:30:55 2010
@@ -173,7 +173,9 @@ public class JavaToWSDLProcessor impleme
             }
         }
         
-        ServiceBuilderFactory builderFactory = ServiceBuilderFactory.getInstance(beanDefinitions);
+        ServiceBuilderFactory builderFactory 
+            = ServiceBuilderFactory.getInstance(beanDefinitions,
+                                                getDataBindingName());
         Class<?> clz = getServiceClass();
         context.put(Class.class, clz);
         if (clz.isInterface()) {

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DefaultServiceBuilderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DefaultServiceBuilderFactory.java?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DefaultServiceBuilderFactory.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/DefaultServiceBuilderFactory.java
Tue Sep  7 17:30:55 2010
@@ -46,7 +46,7 @@ public final class DefaultServiceBuilder
         } else if (ToolConstants.AEGIS_DATABINDING.equals(dbn)) {
             dataBinding = new AegisDatabinding();
         } else {
-            throw new ToolException("Unsupported databinding: " + s);
+            throw new ToolException("Unsupported databinding: " + dbn);
         }
         AbstractServiceFactory builder = null;
         if (Style.Jaxws.equals(s)) {

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
Tue Sep  7 17:30:55 2010
@@ -39,10 +39,16 @@ public abstract class ServiceBuilderFact
         databindingName = ToolConstants.DEFAULT_DATA_BINDING_NAME;
     }
 
-    public static ServiceBuilderFactory getInstance(List<String> beanDefinitions) {
+    public static ServiceBuilderFactory getInstance(List<String> beanDefinitions,
+                                                    String db) {
         ServiceBuilderFactory factory;
         if (beanDefinitions == null || beanDefinitions.isEmpty()) {
-            factory = new DefaultServiceBuilderFactory();
+            if (ToolConstants.JAXB_DATABINDING.equals(db)
+                || ToolConstants.AEGIS_DATABINDING.equals(db)) {
+                factory = new DefaultServiceBuilderFactory();
+            } else {
+                factory = new SpringServiceBuilderFactory(beanDefinitions);
+            }
         } else {
             factory = new SpringServiceBuilderFactory(beanDefinitions);
         }

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java?rev=993441&r1=993440&r2=993441&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
Tue Sep  7 17:30:55 2010
@@ -19,11 +19,13 @@
 
 package org.apache.cxf.tools.java2wsdl.processor.internal;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusApplicationContext;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.frontend.AbstractServiceFactory;
 import org.apache.cxf.service.ServiceBuilder;
@@ -36,8 +38,8 @@ import org.springframework.beans.factory
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.UrlResource;
 
 /**
  * This class constructs ServiceBuilder objects using Spring. These objects are used to access
the services
@@ -117,7 +119,12 @@ public final class SpringServiceBuilderF
             .getExtension(BusApplicationContext.class);
         GenericApplicationContext appContext = new GenericApplicationContext(busApplicationContext);
         XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);
-        reader.loadBeanDefinitions(new ClassPathResource("META-INF/cxf/java2wsbeans.xml"));
+        List<URL> urls = ClassLoaderUtils.getResources("META-INF/cxf/java2wsbeans.xml",

+                                                       SpringServiceBuilderFactory.class);
+        for (URL url : urls) {
+            reader.loadBeanDefinitions(new UrlResource(url));
+        }
+        
         for (String pathname : additionalFilePathnames) {
             try {
                 reader.loadBeanDefinitions(new FileSystemResource(pathname));



Mime
View raw message