You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by jl...@apache.org on 2007/10/25 19:10:56 UTC

svn commit: r588283 [14/18] - in /incubator/cxf/branches/jliu: ./ api/ api/src/main/java/org/apache/cxf/databinding/ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ api/src/main/jav...

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java Thu Oct 25 10:09:20 2007
@@ -47,9 +47,11 @@
     private JavaInterface javaInterface;
     private final List<JavaParameter> parameters = new ArrayList<JavaParameter>();
     private final List<JavaException> exceptions = new ArrayList<JavaException>();
-    private final Map<String, JavaAnnotation> annotations = new HashMap<String, JavaAnnotation>();
+    private final Map<String, JAnnotation> annotations = new HashMap<String, JAnnotation>();
 
     private JavaCodeBlock block;
+
+    private boolean async;
     
     public JavaMethod() {
         this(new JavaInterface());
@@ -107,6 +109,11 @@
         return javaReturn;
     }
 
+    public String getReturnValue() {
+        String value = getClassName(javaReturn);
+        return value == null ? "void" : value;
+    }
+
     public void setReturn(JavaReturn rt) {
         if (rt != null && rt.getType() == null && rt.getClassName() == null) {
             Message msg = new Message("FAIL_TO_CREATE_JAVA_OUTPUT_PARAMETER", LOG, rt.name, this.getName());
@@ -147,7 +154,7 @@
             Message msg = new Message("FAIL_TO_CREATE_JAVA_PARAMETER", LOG, param.name, this.getName());
             throw new ToolException(msg);
         }
-        
+        param.setMethod(this);
         parameters.add(param);
     }
 
@@ -238,18 +245,22 @@
         return this.soapUse;
     }
 
-    public void addAnnotation(String tag, JavaAnnotation annotation) {
+    public void addAnnotation(String tag, JAnnotation annotation) {
         if (annotation == null) {
             return;
         }
         this.annotations.put(tag, annotation);
+        
+        for (String importClz : annotation.getImports()) {
+            getInterface().addImport(importClz);
+        }
     }
 
-    public Collection<JavaAnnotation> getAnnotations() {
+    public Collection<JAnnotation> getAnnotations() {
         return this.annotations.values();
     }
 
-    public Map<String, JavaAnnotation> getAnnotationMap() {
+    public Map<String, JAnnotation> getAnnotationMap() {
         return this.annotations;
     }
 
@@ -261,6 +272,16 @@
         return getParameterList(false);
     }
 
+    private String getClassName(JavaType type) {
+        if (getInterface() == null || getInterface().getPackageName() == null) {
+            return type.getClassName();
+        }
+        if (getInterface().getPackageName().equals(type.getPackageName())) {
+            return type.getSimpleName();
+        }
+        return type.getClassName();
+    }
+
     public List<String> getParameterList(boolean includeAnnotation) {
         List<String> list = new ArrayList<String>();
         StringBuffer sb = new StringBuffer();
@@ -273,10 +294,10 @@
             if (parameter.isHolder()) {
                 sb.append(parameter.getHolderName());
                 sb.append("<");
-                sb.append(parameter.getClassName());
+                sb.append(getClassName(parameter));
                 sb.append(">");
             } else {
-                sb.append(parameter.getClassName());
+                sb.append(getClassName(parameter));
             }
             sb.append(" ");
             sb.append(parameter.getName());
@@ -320,5 +341,13 @@
 
     public JavaCodeBlock getJavaCodeBlock() {
         return this.block;
+    }
+
+    public final boolean isAsync() {
+        return async;
+    }
+
+    public final void setAsync(final boolean newAsync) {
+        this.async = newAsync;
     }
 }

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java Thu Oct 25 10:09:20 2007
@@ -24,10 +24,15 @@
 
     private boolean holder;
     private String holderName;
-    private JavaAnnotation annotation;
+    private JAnnotation annotation;
     private String partName;
 
     private JavaMethod javaMethod;
+
+    /**
+     * Describe callback here.
+     */
+    private boolean callback;
     
     public JavaParameter() {
     }
@@ -52,11 +57,14 @@
         this.holderName = hn;
     }
 
-    public void setAnnotation(JavaAnnotation anno) {
+    public void setAnnotation(JAnnotation anno) {
         this.annotation = anno;
+        for (String importClz : annotation.getImports()) {
+            getMethod().getInterface().addImport(importClz);
+        }        
     }
 
-    public JavaAnnotation getAnnotation() {
+    public JAnnotation getAnnotation() {
         return this.annotation;
     }
 
@@ -96,5 +104,23 @@
 
     public void annotate(Annotator annotator) {
         annotator.annotate(this);
+    }
+
+    /**
+     * Get the <code>Callback</code> value.
+     *
+     * @return a <code>boolean</code> value
+     */
+    public final boolean isCallback() {
+        return callback;
+    }
+
+    /**
+     * Set the <code>Callback</code> value.
+     *
+     * @param newCallback The new Callback value.
+     */
+    public final void setCallback(final boolean newCallback) {
+        this.callback = newCallback;
     }
 }

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java Thu Oct 25 10:09:20 2007
@@ -22,6 +22,7 @@
 import java.util.ArrayList;
 import java.util.List;
 import javax.jws.soap.SOAPBinding;
+import org.apache.cxf.common.util.StringUtils;
 
 public class JavaPort {
     
@@ -149,5 +150,14 @@
     public String getMethodName(String mname) {
         return methodName;
     }
-    
+
+    public String getFullClassName() {
+        StringBuffer sb = new StringBuffer();
+        if (!StringUtils.isEmpty(getPackageName())) {
+            sb.append(getPackageName());
+            sb.append(".");
+        }
+        sb.append(getInterfaceClass());
+        return sb.toString();
+    }
 }

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java Thu Oct 25 10:09:20 2007
@@ -48,14 +48,14 @@
         typeMapping.put("java.math.BigInteger", "new java.math.BigInteger(\"0\")");
         typeMapping.put("java.math.BigDecimal", "new java.math.BigDecimal(\"0\")");
         typeMapping.put("javax.xml.datatype.XMLGregorianCalendar", "null");
-        // javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar()
         typeMapping.put("javax.xml.datatype.Duration", "null");
-        // javax.xml.datatype.DatatypeFactory.newInstance().newDuration(\"P1Y35DT60M60.500S\")
     }
 
     protected String name;
     protected String type;
+    protected String packageName;
     protected String className;
+    protected String simpleName;
     protected String targetNamespace;
     protected Style style;
     protected boolean isHeader;
@@ -63,6 +63,7 @@
     private JavaInterface owner;
     private DefaultValueWriter dvw;
 
+
     public JavaType() {
     }
 
@@ -71,7 +72,7 @@
         this.type = t;
         this.targetNamespace = tns;
         this.className = t;
-    }
+    }    
 
     public void setDefaultValueWriter(DefaultValueWriter w) {
         dvw = w;
@@ -90,6 +91,18 @@
 
     public void setClassName(String clzName) {
         this.className = clzName;
+        resolvePackage(clzName);
+    }
+
+    private void resolvePackage(String clzName) {
+        if (clzName == null || clzName.lastIndexOf(".") == -1) {
+            this.packageName = "";
+            this.simpleName = clzName;
+        } else {
+            int index = clzName.lastIndexOf(".");
+            this.packageName = clzName.substring(0, index);
+            this.simpleName = clzName.substring(index + 1);
+        }
     }
 
     public String getClassName() {
@@ -223,5 +236,13 @@
 
     public void setOwner(JavaInterface intf) {
         this.owner = intf;
+    }
+
+    public String getPackageName() {
+        return this.packageName;
+    }
+
+    public String getSimpleName() {
+        return this.simpleName;
     }
 }

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java Thu Oct 25 10:09:20 2007
@@ -21,8 +21,10 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public class ClassCollector {
 
@@ -33,7 +35,8 @@
     private final Map<String, String> implClassNames = new HashMap<String, String>();
     private final Map<String, String> clientClassNames = new HashMap<String, String>();
     private final Map<String, String> serverClassNames = new HashMap<String, String>();
-    
+
+    private final Set<String> typesPackages = new HashSet<String>();
 
     public boolean containSeiClass(String packagename, String type) {
         return seiClassNames.containsKey(key(packagename, type));
@@ -83,6 +86,10 @@
         return packagename + "#" + type;
     }
 
+    public Set<String> getTypesPackages() {
+        return typesPackages;
+    }
+
     public List<String> getGeneratedFileInfo() {
         List<String> generatedFileList = new ArrayList<String>();
         generatedFileList.addAll(seiClassNames.values());
@@ -94,4 +101,4 @@
         return generatedFileList;
     }
 
-}
\ No newline at end of file
+}

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java Thu Oct 25 10:09:20 2007
@@ -27,6 +27,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.cxf.helpers.FileUtils;
+
 public class Compiler {
     public boolean compileFiles(String[] files, File outputDir) {
         List<String> list = new ArrayList<String>();
@@ -56,12 +58,11 @@
     public boolean internalCompile(String[] args, int sourceFileIndex) {
         Process p = null;
         String cmdArray[] = null;
-      
+        File tmpFile = null;
         try {
             if (isLongCommandLines(args) && sourceFileIndex >= 0) {
                 PrintWriter out = null;
-                File tmpFile = File.createTempFile("cxf-compiler", null);
-                tmpFile.deleteOnExit();
+                tmpFile = FileUtils.createTempFile("cxf-compiler", null);
                 out = new PrintWriter(new FileWriter(tmpFile));
                 for (int i = sourceFileIndex; i < args.length; i++) {
                     if (args[i].indexOf(" ") > -1) {
@@ -122,6 +123,11 @@
         } catch (IOException e) {
             System.err.print("[ERROR] IOException during exec() of compiler \"" + args[0] + "\"");
             System.err.println(". Check your path environment variable.");
+        } finally {
+            if (tmpFile != null
+                && tmpFile.exists()) {
+                FileUtils.delete(tmpFile);
+            }
         }
 
         return false;

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java Thu Oct 25 10:09:20 2007
@@ -364,7 +364,7 @@
         for (Iterator ite2 = binding.getBindingOperations().iterator(); ite2.hasNext();) {
             BindingOperation bindingOp = (BindingOperation)ite2.next();
             String bopStyle = getSOAPOperationStyle(bindingOp);
-            if (!"".equals(bopStyle)) {
+            if (!StringUtils.isEmpty(bopStyle)) {
                 return bopStyle;
             }
         }

Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/StAXUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/StAXUtil.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/StAXUtil.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/util/StAXUtil.java Thu Oct 25 10:09:20 2007
@@ -19,9 +19,17 @@
 
 package org.apache.cxf.tools.util;
 
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Stack;
 import java.util.logging.Logger;
-
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -30,6 +38,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.tools.common.Tag;
 import org.apache.cxf.tools.common.ToolException;
 
 public final class StAXUtil {
@@ -65,5 +75,112 @@
             Message msg = new Message("FAIL_TO_CREATE_STAX", LOG);
             throw new ToolException(msg, e);
         }
+    }
+
+    public static List<Tag> getTags(final File source) throws Exception {
+        List<Tag> tags = new ArrayList<Tag>();
+        List<String> ignoreEmptyTags = Arrays.asList(new String[]{"sequence"});
+
+        InputStream is = new BufferedInputStream(new FileInputStream(source));
+        XMLStreamReader reader = StaxUtils.createXMLStreamReader(is);
+        Tag newTag = null;
+        int count = 0;
+        QName checkingPoint = null;
+        
+        Stack<Tag> stack = new Stack<Tag>();
+
+        while (reader.hasNext()) {
+            int event = reader.next();
+
+            if (checkingPoint != null) {
+                count++;
+            }
+
+            if (event == XMLStreamReader.START_ELEMENT) {
+                newTag = new Tag();
+                newTag.setName(reader.getName());
+
+                if (ignoreEmptyTags.contains(reader.getLocalName())) {
+                    checkingPoint = reader.getName();
+                }
+
+                for (int i = 0; i < reader.getAttributeCount(); i++) {
+                    newTag.getAttributes().add(new QName(reader.getAttributeLocalName(i), 
+                                                         reader.getAttributeValue(i)));
+                }
+                stack.push(newTag);
+            }
+            if (event == XMLStreamReader.CHARACTERS) {
+                newTag.setText(reader.getText());
+            }
+
+            if (event == XMLStreamReader.END_ELEMENT) {
+                Tag startTag = stack.pop();
+
+                if (checkingPoint != null && checkingPoint.equals(reader.getName())) {
+                    if (count == 1) {
+                        //Tag is empty, and it's in the ignore collection, so we just skip this tag
+                    } else {
+                        tags.add(startTag);
+                    }
+                    count = 0;
+                    checkingPoint = null;
+                } else {
+                    tags.add(startTag);
+                }
+            }
+        }
+        reader.close();
+        return tags;
+    }
+
+    public static Tag getTagTree(final File source) throws Exception {
+        return getTagTree(source, new ArrayList<String>());
+    }
+
+    public static Tag getTagTree(final File source, final List<String> ignoreAttr) throws Exception {
+        Tag root = new Tag();
+        root.setName(new QName("root", "root"));
+
+        InputStream is = new BufferedInputStream(new FileInputStream(source));
+        XMLStreamReader reader = StaxUtils.createXMLStreamReader(is);
+        Tag newTag = null;
+
+        Tag currentTag = root;
+        
+        while (reader.hasNext()) {
+            int event = reader.next();
+
+            if (event == XMLStreamReader.START_ELEMENT) {
+                newTag = new Tag();
+                newTag.setName(reader.getName());
+                if (!ignoreAttr.isEmpty()) {
+                    newTag.getIgnoreAttr().addAll(ignoreAttr);
+                }
+
+                for (int i = 0; i < reader.getAttributeCount(); i++) {
+                    newTag.getAttributes().add(new QName(reader.getAttributeLocalName(i), 
+                                                         reader.getAttributeValue(i)));
+                }
+
+                newTag.setParent(currentTag);
+                currentTag.getTags().add(newTag);
+                currentTag = newTag;
+            }
+            if (event == XMLStreamReader.CHARACTERS) {
+                newTag.setText(reader.getText());
+            }
+
+            if (event == XMLStreamReader.END_ELEMENT) {
+                currentTag = currentTag.getParent();
+            }
+        }
+        reader.close();
+        return root;
+    }
+
+    public Tag getLastTag(Tag tag) {
+        int lastIndex = tag.getTags().size() - 1;
+        return tag.getTags().get(lastIndex);
     }
 }

Modified: incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaParameterTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaParameterTest.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaParameterTest.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaParameterTest.java Thu Oct 25 10:09:20 2007
@@ -32,11 +32,12 @@
         assertEquals("\"\"", 
                      holderParameter.getDefaultTypeValue());
         
-        holderParameter = new JavaParameter("org.apache.cxf.tools.common.model.JavaParamter",
-                                            "org.apache.cxf.tools.common.model.JavaParamter", null);
+        holderParameter = new JavaParameter("org.apache.cxf.tools.common.model.JavaParameter",
+                                            "org.apache.cxf.tools.common.model.JavaParameter", null);
         holderParameter.setHolder(true);
         holderParameter.setHolderName("javax.xml.ws.Holder");
-        assertEquals("null", 
-                     holderParameter.getDefaultTypeValue());
+        String defaultTypeValue = holderParameter.getDefaultTypeValue();
+        assertEquals("new org.apache.cxf.tools.common.model.JavaParameter()", 
+                     defaultTypeValue);
     }
 }

Modified: incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaTypeTest.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaTypeTest.java (original)
+++ incubator/cxf/branches/jliu/tools/common/src/test/java/org/apache/cxf/tools/common/model/JavaTypeTest.java Thu Oct 25 10:09:20 2007
@@ -44,4 +44,12 @@
                      new JavaType("i", "org.apache.cxf.tools.common.model.JavaType", null)
                          .getDefaultTypeValue());
     }
+
+    @Test
+    public void testSetClass() {
+        JavaType type = new JavaType();
+        type.setClassName("foo.bar.A");
+        assertEquals("foo.bar", type.getPackageName());
+        assertEquals("A", type.getSimpleName());
+    }
 }

Modified: incubator/cxf/branches/jliu/tools/eclipse-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/eclipse-plugin/pom.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/eclipse-plugin/pom.xml (original)
+++ incubator/cxf/branches/jliu/tools/eclipse-plugin/pom.xml Thu Oct 25 10:09:20 2007
@@ -92,7 +92,7 @@
 
         <dependency>
             <groupId>${pom.groupId}</groupId>
-            <artifactId>cxf-tools-java2wsdl</artifactId>
+            <artifactId>cxf-tools-java2ws</artifactId>
             <version>${project.version}</version>
             <exclusions>
                 <exclusion>

Modified: incubator/cxf/branches/jliu/tools/javato/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/pom.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/pom.xml (original)
+++ incubator/cxf/branches/jliu/tools/javato/pom.xml Thu Oct 25 10:09:20 2007
@@ -32,8 +32,7 @@
     </parent>
 
     <modules>
-        <module>core</module>
-        <module>test</module>
+        <module>ws</module>
     </modules>
 
     <scm>

Propchange: incubator/cxf/branches/jliu/tools/javato/ws/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Oct 25 10:09:20 2007
@@ -0,0 +1,10 @@
+.pmd
+.checkstyle
+.ruleset
+target
+.settings
+.classpath
+.project
+.wtpmodules
+
+

Modified: incubator/cxf/branches/jliu/tools/javato/ws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/pom.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/pom.xml (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/pom.xml Thu Oct 25 10:09:20 2007
@@ -38,40 +38,51 @@
             <artifactId>cxf-tools-common</artifactId>
             <version>${project.version}</version>
         </dependency>
-        
-        
+
+
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-api</artifactId>
             <version>${project.version}</version>
-        </dependency>        
-        
+        </dependency>
+
         <dependency>
-             <groupId>org.apache.cxf</groupId>
-             <artifactId>cxf-rt-frontend-simple</artifactId>
-             <version>${project.version}</version>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-simple</artifactId>
+            <version>${project.version}</version>
         </dependency>
- 
-        
+
+
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-tools-wsdlto-core</artifactId>
             <version>${project.version}</version>
         </dependency>
- 
- 
- 
-         <dependency>
-             <groupId>org.apache.cxf</groupId>
-             <artifactId>cxf-tools-wsdlto-databinding-jaxb</artifactId>
-             <version>${project.version}</version>
-         </dependency>
- 
-         <dependency>
-             <groupId>org.apache.cxf</groupId>
-             <artifactId>cxf-tools-wsdlto-frontend-jaxws</artifactId>
-             <version>${project.version}</version>
+
+
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-wsdlto-databinding-jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-wsdlto-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        
+        <dependency>
+	     <groupId>org.apache.cxf</groupId>
+	     <artifactId>cxf-rt-core</artifactId>
+	     <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
         </dependency>
 
 
@@ -121,11 +132,23 @@
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-databinding-aegis</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
-        </dependency>      
-        
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.cxf</groupId>
+                    <artifactId>cxf-rt-bindings-xml</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
         <dependency>
             <groupId>com.sun.xml.bind</groupId>
             <artifactId>jaxb-xjc</artifactId>
@@ -139,14 +162,14 @@
             <groupId>javax.xml.ws</groupId>
             <artifactId>jaxws-api</artifactId>
         </dependency>
-        
+
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-testutils</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
-        </dependency>        
-        
+        </dependency>
+
 
     </dependencies>
     <build>
@@ -161,6 +184,7 @@
                         <phase>generate-test-sources</phase>
                         <configuration>
                             <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
+
                             <wsdlOptions>
                                 <wsdlOption>
                                     <wsdl>${basedir}/src/test/resources/java2wsdl_wsdl/hello_world_async.wsdl</wsdl>
@@ -182,6 +206,9 @@
                                 </wsdlOption>
                                 <wsdlOption>
                                     <wsdl>${basedir}/src/test/resources/java2wsdl_wsdl/hello_world_bare.wsdl</wsdl>
+                                    <extraargs>
+                                        <arg>-verbose</arg>
+                                    </extraargs>
                                 </wsdlOption>
                                 <wsdlOption>
                                     <wsdl>${basedir}/src/test/resources/java2wsdl_wsdl/hello_world_fault.wsdl</wsdl>
@@ -217,9 +244,9 @@
         </plugins>
     </build>
     <scm>
-	<connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/core</connection>
-	<developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/ws</developerConnection>
-	<url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-tools-java2wsdl</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/core</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/ws</developerConnection>
+        <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-tools-java2wsdl</url>
     </scm>
 
 </project>

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java Thu Oct 25 10:09:20 2007
@@ -54,28 +54,42 @@
             if (!hasInfoOption()) {
                 ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(new HashSet()));
+                if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
+                    env.put(ToolConstants.CFG_OUTPUTDIR, ".");
+                }
+                
+                if (env.get(ToolConstants.CFG_SOURCEDIR) == null) {
+                    env.put(ToolConstants.CFG_SOURCEDIR, ".");
+                }
+                
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }
+                String ft = (String)env.get(ToolConstants.CFG_FRONTEND);
+                if (ft == null || ToolConstants.JAXWS_FRONTEND.equals(ft)) {
+                    ft = ToolConstants.JAXWS_FRONTEND;
+                } else {
+                    ft = ToolConstants.SIMPLE_FRONTEND;
+                    //use aegis databinding for simple front end by default
+                    env.put(ToolConstants.CFG_DATABINDING, ToolConstants.AEGIS_DATABINDING);
+                }
+                env.put(ToolConstants.CFG_FRONTEND, ft); 
                 processor = new JavaToWSDLProcessor();
                 processor.setEnvironment(env);
                 processor.process();
-                String ft = (String)env.get(ToolConstants.CFG_FRONTEND);
-                if (ft == null || "jaxws".equals(ft.toLowerCase())) {
-                    ft = "jaxws";
-                    env.put(ToolConstants.CFG_FRONTEND, "jaxws");
+                
+                
+                if (ft.equals(ToolConstants.JAXWS_FRONTEND)) {
                     if (env.optionSet(ToolConstants.CFG_SERVER) || env.optionSet(ToolConstants.CFG_CLIENT)) {
                         processor = new JAXWSFrontEndProcessor();
                         processor.setEnvironment(env);
                         processor.process();
                     }
-                } else {
-                    ft = "simple";
-                    env.put(ToolConstants.CFG_FRONTEND, "simple");
+                } else {               
                     processor = new SimpleFrontEndProcessor();
                     processor.setEnvironment(env);
                     processor.process();
-                }       
+                }
             }
         } catch (ToolException ex) {
             if (ex.getCause() instanceof BadUsageException) {
@@ -104,28 +118,38 @@
     }
 
     public void checkParams(ErrorVisitor errs) throws ToolException {
-
+        super.checkParams(errs);
         CommandDocument doc = super.getCommandDocument();
 
-        if (doc.hasParameter("frontend")) {
-            String ft = doc.getParameter("frontend");           
-            if (!"simple".equalsIgnoreCase(ft) && !"jaxws".equalsIgnoreCase(ft)) {
-                Message msg = new Message("INVALID_FORNTEND", LOG, new Object[]{ft});               
+        if (doc.hasParameter(ToolConstants.CFG_FRONTEND)) {
+            String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
+            if (!ToolConstants.JAXWS_FRONTEND.equals(ft) 
+                && !ToolConstants.SIMPLE_FRONTEND.equals(ft)) {
+                Message msg = new Message("INVALID_FRONTEND", LOG, new Object[] {ft});
+                errs.add(new ErrorVisitor.UserError(msg.toString()));
+            }
+            
+            if (ToolConstants.SIMPLE_FRONTEND.equals(ft) 
+                && doc.getParameter(ToolConstants.CFG_DATABINDING) != null 
+                && !ToolConstants.
+                AEGIS_DATABINDING.equals(doc.getParameter(ToolConstants.CFG_DATABINDING))) {
+                Message msg = new Message("INVALID_DATABINDING_FOR_SIMPLE", LOG);
                 errs.add(new ErrorVisitor.UserError(msg.toString()));
             }
+            
         }
-        
-        
-        if (doc.hasParameter("wrapperbean")) {
-            String ft = doc.getParameter("frontend");
-            if (ft != null &&  !"jaxws".equalsIgnoreCase(ft)) {
-                Message msg = new Message("CANT_GEN_WRAPPERBEAN", LOG);               
+
+        if (doc.hasParameter(ToolConstants.CFG_WRAPPERBEAN)) {
+            String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
+            if (ft != null && !ToolConstants.JAXWS_FRONTEND.equals(ft)) {
+                Message msg = new Message("WRAPPERBEAN_WITHOUT_JAXWS", LOG);
                 errs.add(new ErrorVisitor.UserError(msg.toString()));
             }
         }
-  
+        
+        
         if (errs.getErrors().size() > 0) {
-            Message msg = new Message("PARAMETER_MISSING", LOG);           
+            Message msg = new Message("PARAMETER_MISSING", LOG);
             throw new ToolException(msg, new BadUsageException(getUsage(), errs));
         }
 

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/Messages.properties?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/Messages.properties (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/Messages.properties Thu Oct 25 10:09:20 2007
@@ -22,7 +22,9 @@
 NOT_A_DIRECTORY = {0} is not a directory
 FILE_NOT_EXIST = File does not exist
 NOT_A_FILE = {0} is not a file
-PARAMETER_MISSING = Required parameter is missing or not valid
-INVALID_FORNTEND = \ "{0}" is not a valid frontend, java2ws only supports jaxws and simple frontend.
-CANT_GEN_WRAPPERBEAN = Wrapperbean only needs to be generated for jaxws front end.
+PARAMETER_MISSING = Parameter is not valid or required parameter is missing
+INVALID_FRONTEND = "{0}" is not a valid frontend, java2ws only supports jaxws and the simple frontend.
+WRAPPERBEAN_WITHOUT_JAXWS = -wrapperbean is only valid for the jaxws front end.
+INVALID_DATABINDING = Invalid value {0} for data binding type.
+INVALID_DATABINDING_FOR_SIMPLE = Simple front end only supports aegis databinding.
 

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/java2ws.xml Thu Oct 25 10:09:20 2007
@@ -26,50 +26,64 @@
 	xmlns:ts="http://cxf.apache.org/Xutil/ToolSpecification">
 
 	<annotation>
-		Examples :
-
-		java2ws org.apache.hello_world_soap_http.Greeter java2ws -cp
-		./tmp org.apache.hello_world_soap_http.Greeter java2ws -o
-		hello.wsdl org.apache.hello_world_soap_http.Greeter java2ws -o
-		hello.wsdl -t http://cxf.apache.org
-		org.apache.hello_world_soap_http.Greeter
+ Examples :
+   java2ws -wsdl org.apache.hello_world_soap_http.Greeter 
+   java2ws -cp ./tmp org.apache.hello_world_soap_http.Greeter -wsdl 
+   java2ws -o hello.wsdl -wsdl org.apache.hello_world_soap_http.Greeter 
+   java2ws -client -server org.apache.hello_world_soap_http.Greeter
+   java2ws -wrapperbean org.apache.hello_world_soap_http.Greeter
 	</annotation>
 	<usage>
-
 		<optionGroup id="options">
+		
+			<option id="databinding" maxOccurs="1">
+				<annotation>
+				    Specify the data binding (aegis or jaxb). Default is jaxb for jaxws 
+				    frontend, and aegis for simple frontend.
+				</annotation>
+				<switch>databinding</switch>
+				<associatedArgument placement="afterSpace">
+				  <annotation>jaxb or aegis</annotation>
+				</associatedArgument>
+			</option>
 			<option id="frontend" maxOccurs="1">
-				<annotation>specify which frontend should be use, support jaxws and simple frontend.</annotation>
+				<annotation>
+					Specify the frontend to use.  jaxws and the simple frontend are supported.
+				</annotation>
 				<switch>frontend</switch>
 				<associatedArgument placement="afterSpace">
-					<annotation>jaxws-or-simple</annotation>
+					<annotation>jaxws or simple</annotation>
 				</associatedArgument>
 			</option>
+
+			<option id="wsdl" maxOccurs="1">
+				<annotation>
+					Specify to generate the WSDL file
+				</annotation>
+				<switch>wsdl</switch>
+			</option>
 			
 			<option id="wrapperbean" maxOccurs="1">
-				<annotation>Specify to genearte wrapper and fault bean</annotation>
+				<annotation>
+					Specify to generate the wrapper and fault bean
+				</annotation>
 				<switch>wrapperbean</switch>
 			</option>
 			
 			<option id="client" maxOccurs="1">
-				<annotation>Specify to genearte client side code</annotation>
+				<annotation>
+					Specify to genearte client side code
+				</annotation>
 				<switch>client</switch>
 			</option>
 				
 			<option id="server" maxOccurs="1">
-				<annotation>Specify to genearte server side code</annotation>
+				<annotation>
+					Specify to genearte server side code
+				</annotation>
 				<switch>server</switch>
 			</option>
-			
-			<option id="impl" maxOccurs="1">
-				<annotation>Specify to generate impl class when "-server" flag is specified</annotation>
-				<switch>impl</switch>
-			</option>			
-						
-			<option id="wsdl" maxOccurs="1">
-				<annotation>Specify generating wsdl</annotation>
-				<switch>wsdl</switch>
-			</option>
-
+								
 			<option id="outputfile" maxOccurs="1">
 				<annotation>
 					Specify the output wsdl file name
@@ -82,17 +96,18 @@
 
 			<option id="outputdir" maxOccurs="1">
 				<annotation>
-					The directory in which the output files are placed
+					The directory in which the output wsdl and other 
+					resource files are placed
 				</annotation>
 				<switch>d</switch>
 				<associatedArgument placement="afterSpace">
-					<annotation>output-directory</annotation>
+					<annotation>resource-directory</annotation>
 				</associatedArgument>
 			</option>
 
 			<option id="sourcedir" maxOccurs="1">
 				<annotation>
-					The directory in which the generated source files
+					The directory in which the generated java source files
 					are placed
 				</annotation>
 				<switch>s</switch>
@@ -102,7 +117,7 @@
 			</option>
 			<option id="classdir" maxOccurs="1">
 				<annotation>
-					The directory in which the generated sources are
+					The directory in which the generated wrapper sources are
 					compiled into. If not specified, the files are not
 					compiled.
 				</annotation>
@@ -139,6 +154,15 @@
 					<annotation>target-namespace</annotation>
 				</associatedArgument>
 			</option>
+			
+			<option id="beans" maxOccurs="unbounded">
+				<annotation>Specify the pathname of a file defining additional Spring beans to customize databinding
+				configuration.</annotation>
+				<switch>beans</switch>
+				<associatedArgument placement="afterSpace">
+					<annotation>pathname of the bean definition file.</annotation>
+				</associatedArgument>
+			</option>
 
 			<option id="servicename" maxOccurs="1">
 				<annotation>
@@ -189,22 +213,26 @@
 			</option>
 
 			<option id="verbose">
-				<annotation>Verbose mode</annotation>
+				<annotation>
+					Verbose mode
+				</annotation>
 				<switch>verbose</switch>
 				<switch>V</switch>
 			</option>
 
 			<option id="quiet">
-				<annotation>Quiet mode</annotation>
+				<annotation>
+					Quiet mode
+				</annotation>
 				<switch>quiet</switch>
 				<switch>q</switch>
 			</option>
-
-
 		</optionGroup>
 
-		<argument id="classname" minOccurs="1" maxOccurs="1">
-			<annotation>SEI class name</annotation>
-		</argument>
+		   <argument id="classname" minOccurs="1" maxOccurs="1">
+			   <annotation>
+			        SEI class name
+			   </annotation>
+		   </argument>
 	</usage>
 </toolspec>

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,39 +19,44 @@
 
 package org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass;
 public class WrapperBeanAnnotator implements Annotator {
 
     public void annotate(final JavaAnnotatable clz) {
-        WrapperBeanClass wrapperBeanClass = null;
+        WrapperBeanClass beanClass = null;
         if (clz instanceof WrapperBeanClass) {
-            wrapperBeanClass = (WrapperBeanClass) clz;
+            beanClass = (WrapperBeanClass) clz;
         } else {
             throw new RuntimeException("WrapperBeanAnnotator expect JavaClass as input");
         }
 
-        JavaAnnotation xmlRootElement = new JavaAnnotation("XmlRootElement");
-        xmlRootElement.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlRootElement.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());
-
-        JavaAnnotation xmlAccessorType = new JavaAnnotation("XmlAccessorType");
-        xmlAccessorType.addArgument("XmlAccessType.FIELD", "null", "");
+        JAnnotation xmlRootElement = new JAnnotation(XmlRootElement.class);
+        xmlRootElement.addElement(new JAnnotationElement("name", 
+                                                         beanClass.getElementName().getLocalPart()));
+        xmlRootElement.addElement(new JAnnotationElement("namespace", 
+                                                         beanClass.getElementName().getNamespaceURI()));
+        
+        JAnnotation xmlAccessorType = new JAnnotation(XmlAccessorType.class);
+        xmlAccessorType.addElement(new JAnnotationElement(null, XmlAccessType.FIELD));
 
-        JavaAnnotation xmlType = new JavaAnnotation("XmlType");
-        //xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlType.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());
+        JAnnotation xmlType = new JAnnotation(XmlType.class);
+        xmlType.addElement(new JAnnotationElement("name", 
+                                                  beanClass.getElementName().getLocalPart()));
+        xmlType.addElement(new JAnnotationElement("namespace", 
+                                                  beanClass.getElementName().getNamespaceURI()));
+        
         // Revisit: why annotation is string?
-        wrapperBeanClass.addAnnotation(xmlRootElement.toString());
-        wrapperBeanClass.addAnnotation(xmlAccessorType.toString());
-        wrapperBeanClass.addAnnotation(xmlType.toString());
-
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessType");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessorType");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlRootElement");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlType");
+        beanClass.addAnnotation(xmlRootElement);
+        beanClass.addAnnotation(xmlAccessorType);
+        beanClass.addAnnotation(xmlType);
     }
 }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java Thu Oct 25 10:09:20 2007
@@ -19,9 +19,13 @@
 
 package org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator;
 
+import javax.xml.bind.annotation.XmlElement;
+
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaField;
 
 public class WrapperBeanFieldAnnotator implements Annotator {
@@ -34,12 +38,13 @@
             throw new RuntimeException("WrapperBeanFiledAnnotator expect JavaField as input");
         }
         String rawName = jField.getRawName();
-        JavaAnnotation xmlElementAnnotation = new JavaAnnotation("XmlElement");
-        
-        xmlElementAnnotation.addArgument("name", rawName);
-        xmlElementAnnotation.addArgIgnoreEmpty("namespace", jField.getTargetNamespace(), "\"");
+        JAnnotation xmlElementAnnotation = new JAnnotation(XmlElement.class);
+        xmlElementAnnotation.addElement(new JAnnotationElement("name", rawName));
+        if (!StringUtils.isEmpty(jField.getTargetNamespace())) {
+            xmlElementAnnotation.addElement(new JAnnotationElement("namespace", 
+                                                                          jField.getTargetNamespace()));
+        }
 
         jField.setAnnotation(xmlElementAnnotation);
-        jField.getOwner().addImport("javax.xml.bind.annotation.XmlElement");
     }
 }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java Thu Oct 25 10:09:20 2007
@@ -24,12 +24,14 @@
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingType;
 import javax.xml.ws.soap.SOAPBinding;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.BusApplicationContext;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
@@ -47,6 +49,12 @@
 import org.apache.cxf.tools.java2wsdl.processor.internal.ServiceBuilderFactory;
 import org.apache.cxf.tools.util.AnnotationUtil;
 import org.apache.cxf.wsdl.WSDLConstants;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
+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;
 
 public class JavaToWSDLProcessor implements Processor {
     private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSDLProcessor.class);
@@ -54,7 +62,8 @@
     private static final String JAVA_CLASS_PATH = "java.class.path";
     private ToolContext context;
     private final List<AbstractGenerator> generators = new ArrayList<AbstractGenerator>();
-
+    private ApplicationContext applicationContext;
+    
     private void customize(ServiceInfo service) {
         if (context.containsKey(ToolConstants.CFG_TNS)) {
             String ns = (String)context.get(ToolConstants.CFG_TNS);
@@ -73,7 +82,28 @@
             service.setName(new QName(service.getName().getNamespaceURI(), svName));
         }
     }
-
+    
+    /**
+     * This is factored out to permit use in a unit test.
+     * @param bus
+     * @return
+     */
+    public static ApplicationContext getApplicationContext(Bus bus, List<String> additionalFilePathnames) {
+        BusApplicationContext busApplicationContext = bus.getExtension(BusApplicationContext.class);
+        GenericApplicationContext appContext = new GenericApplicationContext(busApplicationContext);
+        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);
+        reader.loadBeanDefinitions(new ClassPathResource("META-INF/cxf/java2wsbeans.xml"));
+        for (String pathname : additionalFilePathnames) {
+            try {
+                reader.loadBeanDefinitions(new FileSystemResource(pathname));
+            } catch (BeanDefinitionStoreException bdse) {
+                throw new ToolException("Unable to open bean definition file " + pathname, bdse.getCause());
+            }
+        }
+            
+        return appContext;
+    }
+    
     public void process() throws ToolException {
         String oldClassPath = System.getProperty(JAVA_CLASS_PATH);
         LOG.log(Level.INFO, "OLD_CP", oldClassPath);
@@ -83,6 +113,9 @@
             LOG.log(Level.INFO, "NEW_CP", newCp);
         }
 
+        // check for command line specification of data binding.
+       
+
         ServiceBuilder builder = getServiceBuilder();
         ServiceInfo service = builder.createService();
 
@@ -98,6 +131,7 @@
         if (context.containsKey(ToolConstants.CFG_WRAPPERBEAN)) {
             generators.add(getWrapperBeanGenerator());
             generators.add(getFaultBeanGenerator());
+            
         }
         generate(service, outputDir);
         List<ServiceInfo> serviceList = new ArrayList<ServiceInfo>();
@@ -139,25 +173,38 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     public ServiceBuilder getServiceBuilder() throws ToolException {
-
+        Object beanFilesParameter = context.get(ToolConstants.CFG_BEAN_CONFIG);
+        List<String> beanDefinitions = new ArrayList<String>();
+        if (beanFilesParameter != null) {
+            if (beanFilesParameter instanceof String) {
+                beanDefinitions.add((String)beanFilesParameter);
+            } else if (beanFilesParameter instanceof List) {
+                // is there a better way to avoid the warning?
+                beanDefinitions.addAll((List<String>)beanFilesParameter);
+            }
+        }
+        applicationContext = getApplicationContext(getBus(), beanDefinitions);
         ServiceBuilderFactory builderFactory = ServiceBuilderFactory.getInstance();
         Class<?> clz = getServiceClass();
         context.put(Class.class, clz);
         if (clz.isInterface()) {
             context.put(ToolConstants.GEN_FROM_SEI, Boolean.TRUE);
-            context.put(ToolConstants.SEI_CLASS, clz);
+            context.put(ToolConstants.SEI_CLASS, clz.getName());
         } else {
-            context.put(ToolConstants.IMPL_CLASS, clz);
+            context.put(ToolConstants.IMPL_CLASS, clz.getName());
             if (clz.getInterfaces().length == 1) {
                 context.put(ToolConstants.SEI_CLASS, clz.getInterfaces()[0].getName());
             }
+            //TODO: if it is simple frontend, and the impl class implments 
+            //multiple interfaces
             context.put(ToolConstants.GEN_FROM_SEI, Boolean.FALSE); 
         }
         builderFactory.setServiceClass(clz);
-        // TODO check if user specify the style from cli arguments
-        //      builderFactory.setStyle(style/from/command/line);
-        ServiceBuilder builder = builderFactory.newBuilder();
+        builderFactory.setDatabindingName(getDataBindingName());
+        // The service class determines the frontend, so no need to pass it in twice.
+        ServiceBuilder builder = builderFactory.newBuilder(applicationContext);
 
         builder.validate();
 
@@ -242,7 +289,7 @@
 
     public Class<?> getServiceClass() {
         return AnnotationUtil.loadClass((String)context.get(ToolConstants.CFG_CLASSNAME),
-                                        getClass().getClassLoader());
+                                        Thread.currentThread().getContextClassLoader());
     }
 
     public WSDLConstants.WSDLVersion getWSDLVersion() {
@@ -284,5 +331,12 @@
     public ToolContext getEnvironment() {
         return this.context;
     }
-
+    
+    public String getDataBindingName() {
+        String databindingName = (String)context.get(ToolConstants.CFG_DATABINDING);
+        if (databindingName == null) {
+            databindingName = ToolConstants.DEFAULT_DATA_BINDING_NAME;
+        }
+        return databindingName;
+    }
 }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ServiceBuilderFactory.java Thu Oct 25 10:09:20 2007
@@ -19,17 +19,28 @@
 
 package org.apache.cxf.tools.java2wsdl.processor.internal;
 
+import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.frontend.AbstractServiceFactory;
 import org.apache.cxf.service.ServiceBuilder;
+import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.java2wsdl.processor.FrontendFactory;
+import org.apache.cxf.tools.util.NameUtil;
 
+import org.springframework.context.ApplicationContext;
+/**
+ * This class constructs ServiceBuilder objects. These objects are used to access the services
+ * and the data bindings to generate the wsdl.
+ */
 public final class ServiceBuilderFactory {
     private static ServiceBuilderFactory instance;
+    private static FrontendFactory frontend;
+    private static String databindingName;
     private Class serviceClass;
-    private FrontendFactory frontend;
     
     private ServiceBuilderFactory() {
         frontend = FrontendFactory.getInstance();
+        databindingName = ToolConstants.DEFAULT_DATA_BINDING_NAME;
     }
     
     public static ServiceBuilderFactory getInstance() {
@@ -39,17 +50,39 @@
         return instance;
     }
 
-    public ServiceBuilder newBuilder() {
-        return newBuilder(getStyle());
+    public ServiceBuilder newBuilder(ApplicationContext applicationContext) {
+        return newBuilder(applicationContext, getStyle());
     }
+    
+    /**
+     * Convert a parameter value to the name of a bean we'd use for a data binding.
+     * @param databindingName
+     * @return
+     */
+    public static String databindingNameToBeanName(String dbName) {
+        return NameUtil.capitalize(dbName.toLowerCase()) + ToolConstants.DATABIND_BEAN_NAME_SUFFIX;
+    }
+
+    public ServiceBuilder newBuilder(ApplicationContext applicationContext, FrontendFactory.Style s) {
+        DataBinding dataBinding;
+        String databindingBeanName = databindingNameToBeanName(databindingName);
+        try {
+            dataBinding = (DataBinding)applicationContext.getBean(databindingBeanName);
+        } catch (RuntimeException e) {
+            throw new ToolException("Cannot get databinding bean " + databindingBeanName 
+                                    + " for databinding " + databindingName);
+        }
 
-    public ServiceBuilder newBuilder(FrontendFactory.Style s) {
+        String beanName = getBuilderBeanName(s);
         ServiceBuilder builder = null;
+
         try {
-            String clzName = getBuilderClassName(s);
-            builder = (ServiceBuilder) Class.forName(clzName).newInstance();
-        } catch (Exception e) {
-            throw new ToolException("Can not find or initialize the ServiceBuilder for style: " + s
+            builder = (ServiceBuilder) applicationContext.getBean(beanName, ServiceBuilder.class);
+            AbstractServiceFactory serviceFactory = (AbstractServiceFactory)builder;
+            serviceFactory.setDataBinding(dataBinding);
+        } catch (RuntimeException e) {
+            throw new ToolException("Can not get ServiceBuilder bean " + beanName 
+                                    + "to initialize the ServiceBuilder for style: " + s
                                     + " Reason: \n" + e.getMessage(),
                                     e);
         }
@@ -57,9 +90,14 @@
         return builder;
     }
 
-    protected String getBuilderClassName(FrontendFactory.Style s) {
-        String pkgName = "org.apache.cxf";
-        return pkgName + "." + s.toString().toLowerCase() + "." + s + "ServiceBuilder";
+    /**
+     * Return the name of a prototype bean from Spring that can provide the service. The use of a bean
+     * allows for the possibility of an override.
+     * @param s Style of service
+     * @return name of bean.
+     */
+    protected String getBuilderBeanName(FrontendFactory.Style s) {
+        return s + "ServiceBuilderBean";
     }
 
     public FrontendFactory.Style getStyle() {
@@ -69,5 +107,21 @@
 
     public void setServiceClass(Class c) {
         this.serviceClass = c;
+    }
+
+    /**
+     * Return the databinding name.
+     * @return
+     */
+    public String getDatabindingName() {
+        return databindingName;
+    }
+
+    /**
+     * Set the databinding name
+     * @param databindingName
+     */
+    public void setDatabindingName(String arg) {
+        databindingName = arg;
     }
 }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Messages.properties Thu Oct 25 10:09:20 2007
@@ -21,4 +21,6 @@
 LOAD_WRAPPER_CLASS_FAILED = Can not load wrapper class {0}, please check the @RequestWrapper or @ResponseWrapper and also check the class is in your classpath
 WRAPPER_CLASS_NOT_EXIST = Wrapper class not exist
 SOAPBinding_RPC_ON_METHOD = Method [{0}] processing error : SOAPBinding annotation can not be placed on method with RPC style 
-LOADING_WRAPPER_CLASS = Trying to load wrapper class {0}
\ No newline at end of file
+LOADING_WRAPPER_CLASS = Trying to load wrapper class {0}
+CLASS_DOESNOT_CARRY_WEBSERVICE_ANNO = Class {0} does not carry a WebService annotation
+PARA_OR_RETURN_IMPL_REMOTE = Parameter or return type directly or indirectly implemented the java.rmi.Remote interface in Class {0}  
\ No newline at end of file

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/AbstractJaxwsGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/AbstractJaxwsGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/AbstractJaxwsGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/AbstractJaxwsGenerator.java Thu Oct 25 10:09:20 2007
@@ -21,6 +21,7 @@
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
+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.util.ClassCollector;
@@ -28,15 +29,19 @@
 
 public abstract class AbstractJaxwsGenerator extends AbstractGenerator {
     protected static final Logger LOG = LogUtils.getL7dLogger(AbstractJaxwsGenerator.class);
-    protected static final String TEMPLATE_BASE = "org/apache/cxf/tools" 
-        + "/java2wsdl/processor/internal/jaxws/generator/template";
+    protected static final String TEMPLATE_BASE = "org/apache/cxf/tools"
+                                                  + "/java2wsdl/processor/internal/jaxws/generator/template";
 
     public abstract boolean passthrough();
 
     public abstract void generate(ToolContext penv) throws ToolException;
+
     public void register(final ClassCollector collector, String packageName, String fileName) {
-        
+
     }
 
-}
+    public String getOutputDir() {
+        return (String)env.get(ToolConstants.CFG_SOURCEDIR);
+    }
 
+}

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/JaxwsClientGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/JaxwsClientGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/JaxwsClientGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/generator/JaxwsClientGenerator.java Thu Oct 25 10:09:20 2007
@@ -33,9 +33,7 @@
 
     private static final String CLIENT_TEMPLATE = TEMPLATE_BASE + "/javafirst-client.vm";
 
-    public JaxwsClientGenerator() {
-        this.name = ToolConstants.CLT_GENERATOR;
-    }
+
 
     public boolean passthrough() {
         if (env.optionSet(ToolConstants.CFG_CLIENT)) {
@@ -61,7 +59,7 @@
             setAttributes("service", service);
             setAttributes("port", port);
             setAttributes("address", "http://localhost:9090/hello");
-            setAttributes("seiClass", ((Class)env.get(ToolConstants.SEI_CLASS)).getName());
+            setAttributes("seiClass", (String)env.get(ToolConstants.SEI_CLASS));
             setCommonAttributes();
             doWrite(CLIENT_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Client"));
 

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java Thu Oct 25 10:09:20 2007
@@ -21,6 +21,7 @@
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
+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.util.ClassCollector;
@@ -34,8 +35,12 @@
     public abstract boolean passthrough();
 
     public abstract void generate(ToolContext penv) throws ToolException;
+
     public void register(final ClassCollector collector, String packageName, String fileName) {
         
     }
-
+    public String getOutputDir() {
+        return (String)env.get(ToolConstants.CFG_SOURCEDIR);           
+    } 
+    
 }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java Thu Oct 25 10:09:20 2007
@@ -55,10 +55,10 @@
         for (JavaInterface intf : interfaces.values()) {
             clearAttributes();
             setAttributes("intf", intf);
-            setAttributes("seiClass", ((Class)env.get(ToolConstants.SEI_CLASS)).getName());
+            setAttributes("seiClass", env.get(ToolConstants.SEI_CLASS));
             setCommonAttributes();
             doWrite(CLIENT_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Client"));
-
+            env.put(ToolConstants.CLIENT_CLASS, intf.getFullClassName() + "Client");
         }
     }
 }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java Thu Oct 25 10:09:20 2007
@@ -59,6 +59,7 @@
         for (JavaInterface intf : interfaces.values()) {
             clearAttributes();
             setAttributes("intf", intf);
+            setAttributes("seiClass", env.get(ToolConstants.SEI_CLASS));
             setCommonAttributes();
 
             doWrite(IMPL_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Impl"));

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java Thu Oct 25 10:09:20 2007
@@ -59,9 +59,10 @@
         for (JavaInterface intf : interfaces.values()) {
             clearAttributes();
             setAttributes("intf", intf);
-            setAttributes("implClass", ((Class)env.get(ToolConstants.IMPL_CLASS)).getName());
+            setAttributes("implClass", env.get(ToolConstants.IMPL_CLASS));
             setCommonAttributes();
             doWrite(SERVER_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Server"));
+            env.put(ToolConstants.SERVER_CLASS, intf.getFullClassName() + "Server");
         }
     }
 

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm Thu Oct 25 10:09:20 2007
@@ -22,14 +22,14 @@
 
 package $intf.PackageName;
 import org.apache.cxf.bus.CXFBusFactory;
-import org.apache.cxf.frontend.ServerFactoryBean;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.apache.cxf.frontend.ClientFactoryBean;
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 
 /**
- * This cla  ss was generated by the CXF $version
+ * This class was generated by the CXF $version
  * $currentdate
- * Generated source version: $version
- * 
+ * Generated source version: $version 
  */
  public class ${intf.Name}Client {
     public static void main(String[] args) {
@@ -40,6 +40,6 @@
         clientBean.setTransportId("http://schemas.xmlsoap.org/wsdl/http/");
         clientBean.setServiceClass(${seiClass}.class);
         proxyFactory.getServiceFactory().setDataBinding(new AegisDatabinding());
-        ${intf.FullClassName} client = (${intf.FullClassName})proxyFactory.create();
+        ${seiClass} client = (${seiClass})proxyFactory.create();
     }
  }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm Thu Oct 25 10:09:20 2007
@@ -23,13 +23,13 @@
 package $intf.PackageName;
 
 /**
- * This cla  ss was generated by the CXF $version
+ * This class was generated by the CXF $version
  * $currentdate
  * Generated source version: $version
  * 
  */
                       
-public class ${intf.Name}Impl implements $intf.Name {
+public class ${intf.Name}Impl implements ${seiClass} {
 #foreach ($method in $intf.Methods)
   public $method.return.ClassName ${method.Name}(#if($method.ParameterList.size() == 0))#end#if($method.ParameterList.size() != 0)#foreach ($param in ${method.ParameterList})$param#end)#end#if($method.Exceptions.size() > 0) throws#foreach($exception in $method.Exceptions) $exception.ClassName#if($method.Exceptions.size() != $velocityCount),#end#end#end {  
 #foreach ($parameter in $method.Parameters)

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/Hello.java Thu Oct 25 10:09:20 2007
@@ -18,6 +18,9 @@
  */
 package org.apache.cxf.tools.fortest;
 
+import javax.jws.WebService;
+
+@WebService
 public interface Hello {
     String sayHi(String arg);
 }

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPrice.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPrice.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPrice.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPrice.java Thu Oct 25 10:09:20 2007
@@ -23,7 +23,6 @@
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
 
 
 /**
@@ -48,7 +47,6 @@
  * 
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {"responseType" })
 @XmlRootElement(name = "getPrice")
 public class GetPrice {
 

Modified: incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPriceResponse.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPriceResponse.java?rev=588283&r1=588282&r2=588283&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPriceResponse.java (original)
+++ incubator/cxf/branches/jliu/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/withannotation/doc/jaxws/GetPriceResponse.java Thu Oct 25 10:09:20 2007
@@ -22,7 +22,6 @@
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
 
 
 /**
@@ -47,7 +46,6 @@
  * 
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {"responseType" })
 @XmlRootElement(name = "getPriceResponse")
 public class GetPriceResponse {
 



Re: svn commit: r588283 [14/18] - in /incubator/cxf/branches/jliu: ./ api/ api/src/main/java/org/apache/cxf/databinding/ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ api/src/main/jav...

Posted by Daniel Kulp <dk...@apache.org>.

Glen,

On Friday 26 October 2007, Glen Mazza wrote:
> Am Donnerstag, den 25.10.2007, 17:10 +0000 schrieb jliu@apache.org:
> > Modified:
> > +    public final void setAsync(final boolean newAsync) {
> > +        this.async = newAsync;
> >      }
>
> Hmmm.  Pardon the Java 101 question, but what does the "final"
> qualifier on the newAsync argument signify?
>
> Thanks,
> Glen

For primitives like booleans, it basically means the variable is "const" 
and cannot be changed.    For non-primitives, it means the variable 
cannot be assigned a new value, but the object it does point to can be 
modified (getters/setters/etc...).     The main use for having a final 
parameter is if your method then creates an anonymous inner class or 
similar that needs access to it.   In that case, it would need to be 
final or the compiler will complain.


-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

RE: svn commit: r588283 [14/18] - in /incubator/cxf/branches/jliu: ./ api/ api/src/main/java/org/apache/cxf/databinding/api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/api/src/main/java/org/apache/cxf/phase/ api/src/main/jav.

Posted by "Liu, Jervis" <jl...@iona.com>.
I wonder as well, this "final" qualifier does not seem to be needed. This changed is merged from trunk to jsr-311 branch, which was originally checked in by James in  REV 575213. James, it is a call for you now. :-)

Cheers,
Jervis

> -----Original Message-----
> From: Glen Mazza [mailto:glen.mazza@verizon.net]
> Sent: 2007?10?27? 7:46
> To: cxf-dev@incubator.apache.org
> Subject: Re: svn commit: r588283 [14/18] - in 
> /incubator/cxf/branches/jliu: ./ api/ 
> api/src/main/java/org/apache/cxf/databinding/api/src/main/java
> /org/apache/cxf/io/ 
> api/src/main/java/org/apache/cxf/message/api/src/main/java/org
> /apache/cxf/phase/ api/src/main/jav.
> 
> 
> Am Donnerstag, den 25.10.2007, 17:10 +0000 schrieb jliu@apache.org:
> > Modified: 
> incubator/cxf/branches/jliu/tools/common/src/main/java/org/apa
> che/cxf/tools/common/model/JavaMethod.java
> > URL: 
> http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools
> /common/src/main/java/org/apache/cxf/tools/common/model/JavaMe
> thod.java?rev=588283&r1=588282&r2=588283&view=diff
> > 
> ==============================================================
> ================
> > --- 
> incubator/cxf/branches/jliu/tools/common/src/main/java/org/apa
> che/cxf/tools/common/model/JavaMethod.java (original)
> > +++ 
> incubator/cxf/branches/jliu/tools/common/src/main/java/org/apa
> che/cxf/tools/common/model/JavaMethod.java Thu Oct 25 10:09:20 2007
> > +
> > +    public final void setAsync(final boolean newAsync) {
> > +        this.async = newAsync;
> >      }
> 
> Hmmm.  Pardon the Java 101 question, but what does the 
> "final" qualifier
> on the newAsync argument signify?
> 
> Thanks,
> Glen
> 
> 
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: svn commit: r588283 [14/18] - in /incubator/cxf/branches/jliu: ./ api/ api/src/main/java/org/apache/cxf/databinding/ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ api/src/main/jav...

Posted by Glen Mazza <gl...@verizon.net>.
Am Donnerstag, den 25.10.2007, 17:10 +0000 schrieb jliu@apache.org:
> Modified: incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
> URL: http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?rev=588283&r1=588282&r2=588283&view=diff
> ==============================================================================
> --- incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java (original)
> +++ incubator/cxf/branches/jliu/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java Thu Oct 25 10:09:20 2007
> +
> +    public final void setAsync(final boolean newAsync) {
> +        this.async = newAsync;
>      }

Hmmm.  Pardon the Java 101 question, but what does the "final" qualifier
on the newAsync argument signify?

Thanks,
Glen