cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r734836 - in /cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/util/ wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ wsdlto/frontend/jaxws/src/m...
Date Thu, 15 Jan 2009 22:03:57 GMT
Author: dkulp
Date: Thu Jan 15 14:03:57 2009
New Revision: 734836

URL: http://svn.apache.org/viewvc?rev=734836&view=rev
Log:
[CXF-1979] If something else is named Service, make sure it's qualified

Modified:
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java
    cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
    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/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java?rev=734836&r1=734835&r2=734836&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java Thu Jan
15 14:03:57 2009
@@ -69,9 +69,9 @@
         Set<String> dirSet = new HashSet<String>();
         ClassCollector classCollector = context.get(ClassCollector.class);
         List<String> fileList = new ArrayList<String>();
-        Iterator ite = classCollector.getGeneratedFileInfo().iterator();
+        Iterator<String> ite = classCollector.getGeneratedFileInfo().iterator();
         while (ite.hasNext()) {
-            String fileName = (String)ite.next();
+            String fileName = ite.next();
             fileName = fileName.replace('.', File.separatorChar);
             String dirName = fileName.substring(0, fileName.lastIndexOf(File.separator) +
1);
             

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java?rev=734836&r1=734835&r2=734836&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java Thu
Jan 15 14:03:57 2009
@@ -19,12 +19,12 @@
 
 package org.apache.cxf.tools.util;
 
-import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 
 public class ClassCollector {
 
@@ -90,8 +90,8 @@
         return typesPackages;
     }
 
-    public List<String> getGeneratedFileInfo() {
-        List<String> generatedFileList = new ArrayList<String>();
+    public Collection<String> getGeneratedFileInfo() {
+        Set<String> generatedFileList = new TreeSet<String>();
         generatedFileList.addAll(seiClassNames.values());
         generatedFileList.addAll(typesClassNames.values());
         generatedFileList.addAll(exceptionClassNames.values());

Modified: cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=734836&r1=734835&r2=734836&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Thu Jan 15 14:03:57 2009
@@ -295,7 +295,7 @@
 
     private boolean addedToClassCollector(String packageName) {
         ClassCollector classCollector = context.get(ClassCollector.class);
-        List<String> files = (List<String>)classCollector.getGeneratedFileInfo();
+        Collection<String> files = classCollector.getGeneratedFileInfo();
         for (String file : files) {
             int dotIndex = file.lastIndexOf(".");
             String sub = file.substring(0, dotIndex - 1);

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=734836&r1=734835&r2=734836&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
Thu Jan 15 14:03:57 2009
@@ -65,7 +65,8 @@
         if (passthrough()) {
             return;
         }
-
+        ClassCollector collector = penv.get(ClassCollector.class);
+        
         Map<String, JavaServiceClass> serviceClasses = javaModel.getServiceClasses();
         
         if (serviceClasses.size() == 0) {
@@ -113,10 +114,20 @@
                 location = url;
             }
             
+            String serviceSuperclass = "Service";
+            for (String s : collector.getGeneratedFileInfo()) {
+                if (s.equals(js.getPackageName() + ".Service")) {
+                    serviceSuperclass = "javax.xml.ws.Service";
+                }
+            }
             clearAttributes();
-
+            
             setAttributes("service", js);
             setAttributes("wsdlLocation", location);
+            setAttributes("serviceSuperclass", serviceSuperclass);
+            if ("Service".equals(serviceSuperclass)) {
+                js.addImport("javax.xml.ws.Service");
+            }
             setAttributes("wsdlUrl", url);
             setCommonAttributes();
 

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm?rev=734836&r1=734835&r2=734836&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
Thu Jan 15 14:03:57 2009
@@ -24,9 +24,6 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import javax.xml.namespace.QName;
-#if (${service.Name} != "Service")
-import javax.xml.ws.Service;
-#end
 import javax.xml.ws.WebEndpoint;
 import javax.xml.ws.WebServiceClient;
 import javax.xml.ws.WebServiceFeature;
@@ -55,7 +52,7 @@
 #foreach ($annotation in $service.Annotations)
 $annotation
 #end
-public class ${service.Name} extends #if (${service.Name} == "Service")javax.xml.ws.Service#else
Service#end {
+public class ${service.Name} extends ${serviceSuperclass} {
 
     public final static URL WSDL_LOCATION;
     public final static QName SERVICE = new QName("$service.Namespace", "$service.ServiceName");



Mime
View raw message