cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1062051 - in /cxf/trunk/tools/wsdlto: frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/ frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ frontend/jaxws/src/main/resources/META-INF/ ...
Date Fri, 21 Jan 2011 22:18:27 GMT
Author: dkulp
Date: Fri Jan 21 22:18:27 2011
New Revision: 1062051

URL: http://svn.apache.org/viewvc?rev=1062051&view=rev
Log:
[CXF-3268] Add a jaxws21 profile to the tooling to have it not output
the stuff that is specific to jaxws 2.2

Added:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWS21Container.java
  (with props)
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWS21ServiceGenerator.java
  (with props)
Modified:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/tools-plugin.xml
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
    cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java

Added: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWS21Container.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWS21Container.java?rev=1062051&view=auto
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWS21Container.java
(added)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWS21Container.java
Fri Jan 21 22:18:27 2011
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.toolspec.ToolSpec;
+
+/**
+ * 
+ */
+public class JAXWS21Container extends JAXWSContainer {
+    public JAXWS21Container(ToolSpec toolspec) throws Exception {
+        super(toolspec);
+    }
+    public void validate(ToolContext env) throws ToolException {
+        super.validate(env);
+        Object o = env.get(ToolConstants.CFG_XJC_ARGS);
+        if (o instanceof String) {
+            o = new String[] {(String)o, "-target", "2.1"};
+            env.put(ToolConstants.CFG_XJC_ARGS, o);
+        } else if (o == null) {
+            o = new String[] {"-target", "2.1"};
+            env.put(ToolConstants.CFG_XJC_ARGS, o);
+        } else {
+            String[] xjcArgs = (String[])o;
+            String tmp[] = new String[xjcArgs.length + 2];
+            System.arraycopy(xjcArgs, 0, tmp, 0, xjcArgs.length);
+            tmp[xjcArgs.length] = "-target";
+            tmp[xjcArgs.length + 1] = "2.1";
+            env.put(ToolConstants.CFG_XJC_ARGS, tmp);
+        }
+    }
+}

Propchange: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWS21Container.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWS21Container.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWS21ServiceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWS21ServiceGenerator.java?rev=1062051&view=auto
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWS21ServiceGenerator.java
(added)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWS21ServiceGenerator.java
Fri Jan 21 22:18:27 2011
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.generators;
+
+/**
+ * 
+ */
+public class JAXWS21ServiceGenerator extends ServiceGenerator {
+    public boolean isJaxws22() {
+        return false;
+    }
+}

Propchange: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWS21ServiceGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWS21ServiceGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?rev=1062051&r1=1062050&r2=1062051&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
Fri Jan 21 22:18:27 2011
@@ -137,7 +137,7 @@ public class ServiceGenerator extends Ab
                 setAttributes("wsdlUrl", url);
                 setCommonAttributes();
                 
-                if (Service.class.getDeclaredConstructors().length == 2) {
+                if (isJaxws22()) {
                     setAttributes("jaxws22", true);
                 }
     
@@ -146,6 +146,10 @@ public class ServiceGenerator extends Ab
             }
         }
     }
+    
+    public boolean isJaxws22() {
+        return Service.class.getDeclaredConstructors().length == 2;
+    }
 
     public void register(final ClassCollector collector, String packageName, String fileName)
{
         collector.addServiceClassName(packageName , fileName , packageName + "." + fileName);

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/tools-plugin.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/tools-plugin.xml?rev=1062051&r1=1062050&r2=1062051&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/tools-plugin.xml (original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/tools-plugin.xml Fri
Jan 21 22:18:27 2011
@@ -20,17 +20,31 @@ under the License.
 
 <plugin name="jaxws" version="" provider="cxf.apache.org" xmlns="http://cxf.apache.org/tools/plugin">
     <frontend name="jaxws" package="org.apache.cxf.tools.wsdlto.frontend.jaxws" profile="JAXWSProfile">
-	<container name="JAXWSContainer" toolspec="jaxws-toolspec.xml"/>
-	<processor name="WSDLToJavaProcessor" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.processor"/>
-	<builder name="JAXWSDefinitionBuilder" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11"/>
-	<generators package="org.apache.cxf.tools.wsdlto.frontend.jaxws.generators">
-	    <generator name="AntGenerator"/>
-	    <generator name="ClientGenerator"/>
-	    <generator name="FaultGenerator"/>
-	    <generator name="ImplGenerator"/>
-	    <generator name="SEIGenerator"/>
-	    <generator name="ServerGenerator"/>
-	    <generator name="ServiceGenerator"/>
-	</generators>
+	   <container name="JAXWSContainer" toolspec="jaxws-toolspec.xml"/>
+	   <processor name="WSDLToJavaProcessor" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.processor"/>
+	   <builder name="JAXWSDefinitionBuilder" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11"/>
+	   <generators package="org.apache.cxf.tools.wsdlto.frontend.jaxws.generators">
+	       <generator name="AntGenerator"/>
+	       <generator name="ClientGenerator"/>
+	       <generator name="FaultGenerator"/>
+	       <generator name="ImplGenerator"/>
+	       <generator name="SEIGenerator"/>
+	       <generator name="ServerGenerator"/>
+	       <generator name="ServiceGenerator"/>
+	   </generators>
+    </frontend>
+    <frontend name="jaxws21" package="org.apache.cxf.tools.wsdlto.frontend.jaxws" profile="JAXWSProfile">
+       <container name="JAXWS21Container" toolspec="jaxws-toolspec.xml"/>
+       <processor name="WSDLToJavaProcessor" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.processor"/>
+       <builder name="JAXWSDefinitionBuilder" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11"/>
+       <generators package="org.apache.cxf.tools.wsdlto.frontend.jaxws.generators">
+           <generator name="AntGenerator"/>
+           <generator name="ClientGenerator"/>
+           <generator name="FaultGenerator"/>
+           <generator name="ImplGenerator"/>
+           <generator name="SEIGenerator"/>
+           <generator name="ServerGenerator"/>
+           <generator name="JAXWS21ServiceGenerator"/>
+       </generators>
     </frontend>
 </plugin>
\ No newline at end of file

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java?rev=1062051&r1=1062050&r2=1062051&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
Fri Jan 21 22:18:27 2011
@@ -50,7 +50,7 @@ public class JAXWSProfileTest extends As
 
         Map<String, FrontEnd> frontends = loader.getFrontEnds();
         assertNotNull(frontends);
-        assertEquals(1, frontends.size());
+        assertEquals(2, frontends.size());
 
         FrontEnd frontend = getFrontEnd(frontends, 0);
         assertEquals("jaxws", frontend.getName());

Modified: cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java?rev=1062051&r1=1062050&r2=1062051&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
(original)
+++ cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
Fri Jan 21 22:18:27 2011
@@ -41,7 +41,7 @@ public class PluginLoaderTest extends As
         
         Map<String, FrontEnd> frontends = loader.getFrontEnds();
         assertNotNull(frontends);
-        assertEquals(1, frontends.size());
+        assertEquals(2, frontends.size());
 
         FrontEnd frontend = getFrontEnd(frontends, 0);
         assertEquals("jaxws", frontend.getName());



Mime
View raw message