cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r440665 [2/2] - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/ common/src/main/java/org/apache/cxf/tools/util/ common/src/test/java/org/apa...
Date Wed, 06 Sep 2006 09:22:40 GMT
Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/TypesCodeWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/TypesCodeWriter.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/TypesCodeWriter.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/TypesCodeWriter.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,73 @@
+/**
+ * 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.wsdl2java.databindings.jaxb;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.sun.codemodel.CodeWriter;
+import com.sun.codemodel.JPackage;
+
+public class TypesCodeWriter extends CodeWriter {
+
+    /** The target directory to put source code. */
+    private File target;
+    
+    private List<String> excludeFileList = new ArrayList<String>();
+    private List<String> excludePkgList;
+
+    public TypesCodeWriter(File ftarget, List<String> excludePkgs) throws IOException {
+        target = ftarget;
+        excludePkgList = excludePkgs;
+    }
+
+    public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
+        return new FileOutputStream(getFile(pkg, fileName));
+    }
+
+    protected File getFile(JPackage pkg, String fileName) throws IOException {
+        String dirName = pkg.name().replace('.', File.separatorChar);
+        File dir = pkg.isUnnamed() ? target : new File(target, dirName);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        File fn = new File(dir, fileName);
+        if (excludePkgList.contains(pkg.name())) {
+            excludeFileList.add(dirName + File.separator + fileName);
+        }
+        if (fn.exists() && !fn.delete()) {
+            throw new IOException(fn + ": Can't delete previous version");
+        }
+        return fn;
+    }
+
+    public void close() throws IOException {
+
+    }
+    
+    public List<String> getExcludeFileList() {
+        return excludeFileList;
+    }
+    
+}

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/TypesCodeWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,156 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.common.FrontEndGenerator;
+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;
+import org.apache.cxf.tools.util.FileWriterUtil;
+import org.apache.cxf.version.Version;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+
+public abstract class AbstractGenerator implements FrontEndGenerator {
+
+    public static final String TEMPLATE_BASE = "org/apache/cxf/tools/wsdl2java/frontend/jaxws/template";
+    private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
+    protected ToolContext env;
+    //protected JavaModel javaModel;
+    protected Map<String, Object> attributes = new HashMap<String, Object>();
+    protected String name;
+    //protected ClassCollector collector;
+
+    public AbstractGenerator() {
+    }
+
+    public abstract boolean passthrough();
+
+    public abstract void generate(ToolContext penv) throws ToolException;
+
+    protected void doWrite(String templateName, Writer outputs) throws ToolException {
+        Template tmpl = null;
+        try {
+            tmpl = Velocity.getTemplate(templateName);
+        } catch (Exception e) {
+            Message msg = new Message("TEMPLATE_MISSING", LOG, templateName);
+            throw new ToolException(msg, e);
+        }
+
+        VelocityContext ctx = new VelocityContext();
+
+        for (Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
+            String key = (String)iter.next();
+            ctx.put(key, attributes.get(key));
+        }
+
+        VelocityWriter writer = new VelocityWriter(outputs);
+        try {
+            tmpl.merge(ctx, writer);
+            writer.close();
+        } catch (Exception e) {
+            Message msg = new Message("VELOCITY_ENGINE_WRITE_ERRORS", LOG);
+            throw new ToolException(msg, e);
+        }
+    }
+
+    protected boolean isCollision(String packageName, String filename) throws ToolException {
+        return isCollision(packageName, filename, ".java");
+    }
+
+    protected boolean isCollision(String packageName, String filename, String ext) throws ToolException {
+        FileWriterUtil fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_OUTPUTDIR));
+        return fw.isCollision(packageName, filename + ext);
+    }
+
+    protected Writer parseOutputName(String packageName, String filename, String ext) throws ToolException {
+        FileWriterUtil fw = null;
+        Writer writer = null;
+
+        fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_OUTPUTDIR));
+        try {
+            writer = fw.getWriter(packageName, filename + ext);
+        } catch (IOException ioe) {
+            Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, packageName + "." + filename + ext);
+            throw new ToolException(msg, ioe);
+        }
+
+        return writer;
+    }
+
+    protected Writer parseOutputName(String packageName, String filename) throws ToolException {
+        ClassCollector collector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
+        if (ToolConstants.CLT_GENERATOR.equals(name)) {
+            collector.addClientClassName(packageName , filename , packageName + "." + filename);
+        }
+
+        if (ToolConstants.FAULT_GENERATOR.equals(name)) {
+            collector.addExceptionClassName(packageName , filename , packageName + "." + filename);
+        }
+        if (ToolConstants.SERVICE_GENERATOR.equals(name)) {
+            collector.addServiceClassName(packageName , filename , packageName + "." + filename);
+        }
+        if (ToolConstants.SVR_GENERATOR.equals(name)) {
+            collector.addServiceClassName(packageName , filename , packageName + "." + filename);
+
+        }
+
+
+        return parseOutputName(packageName, filename, ".java");
+    }
+
+    protected void setAttributes(String n, Object value) {
+        attributes.put(n, value);
+    }
+
+    protected void setCommonAttributes() {
+        attributes.put("currentdate", Calendar.getInstance().getTime());
+        attributes.put("version", Version.getCurrentVersion());
+    }
+
+    protected void clearAttributes() {
+        attributes.clear();
+    }
+
+    public void setEnvironment(ToolContext penv) {
+        this.env = penv;
+
+    }
+
+    public ToolContext getEnvironment() {
+        return this.env;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,57 @@
+/**
+ * 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.wsdl2java.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.model.JavaModel;
+
+public class AntGenerator extends AbstractGenerator {
+
+    private static final String ANT_TEMPLATE = TEMPLATE_BASE + "/build.vm";
+
+    public AntGenerator() {
+        this.name = ToolConstants.ANT_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_ANT)
+                || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        }
+        return true;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+        clearAttributes();
+        setAttributes("intfs", javaModel.getInterfaces().values());
+        setAttributes("wsdlLocation", javaModel.getLocation());
+        setCommonAttributes();
+
+        doWrite(ANT_TEMPLATE, parseOutputName(null, "build", ".xml"));
+    }
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,101 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.util.Iterator;
+import java.util.Map;
+
+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.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+
+public class ClientGenerator extends AbstractGenerator {
+
+    private static final String CLT_TEMPLATE = TEMPLATE_BASE + "/client.vm";
+
+    public ClientGenerator() {
+        this.name = ToolConstants.CLT_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        }
+        return true;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        JavaServiceClass js = null;
+        JavaPort jp = null;
+
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+
+            Iterator it = javaModel.getServiceClasses().values().iterator();
+            while (it.hasNext()) {
+                String serviceName = "";
+                js = (JavaServiceClass)it.next();
+                Iterator i = js.getPorts().iterator();
+                while (i.hasNext()) {
+                    jp = (JavaPort)i.next();
+                    if (jp.getPortType().equals(interfaceName)) {
+                        serviceName = js.getName();
+
+                        break;
+                    }
+                }
+                if (!"".equals(serviceName)) {
+                    break;
+                }
+            }
+
+
+            String clientClassName = interfaceName + "Client";
+            while (isCollision(intf.getPackageName(), clientClassName)) {
+                clientClassName = clientClassName + "_Client";
+            }
+
+            clearAttributes();
+            setAttributes("clientClassName", clientClassName);
+            setAttributes("intf", intf);
+            setAttributes("service", js);
+            setAttributes("port", jp);
+
+            setCommonAttributes();
+
+            doWrite(CLT_TEMPLATE, parseOutputName(intf.getPackageName(),
+                    clientClassName));
+        }
+    }
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,76 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.util.Iterator;
+import java.util.Map;
+
+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.model.JavaExceptionClass;
+import org.apache.cxf.tools.common.model.JavaField;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.util.ProcessorUtil;
+
+public class FaultGenerator extends AbstractGenerator {
+
+    private static final String FAULT_TEMPLATE = TEMPLATE_BASE + "/fault.vm";
+
+    public FaultGenerator() {
+        this.name = ToolConstants.FAULT_GENERATOR;
+    }
+
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT)
+            || env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
+            return true;
+        }
+        return false;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaExceptionClass> exceptionClasses = javaModel
+                .getExceptionClasses();
+        for (Iterator iter = exceptionClasses.keySet().iterator(); iter
+                .hasNext();) {
+            String expClassName = (String)iter.next();
+            JavaExceptionClass expClz =
+                exceptionClasses.get(expClassName);
+
+            clearAttributes();
+            setAttributes("expClass", expClz);
+            for (JavaField jf : expClz.getFields()) {
+                setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
+            }
+            setCommonAttributes();
+            doWrite(FAULT_TEMPLATE, parseOutputName(expClz.getPackageName(),
+                    expClz.getName()));
+        }
+    }
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/HandlerConfigGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/HandlerConfigGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/HandlerConfigGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/HandlerConfigGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,84 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.io.Writer;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import org.apache.cxf.helpers.XMLUtils;
+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.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JavaInterface;
+import org.apache.cxf.tools.util.ProcessorUtil;
+
+public class HandlerConfigGenerator extends AbstractGenerator {
+
+    private static final String HANDLER_CHAIN_NAME = "";
+    private JavaInterface intf;
+    private JavaAnnotation handlerChainAnnotation;
+
+    public HandlerConfigGenerator() {
+        this.name = ToolConstants.HANDLER_GENERATOR;
+    }
+
+    public JavaAnnotation getHandlerAnnotation() {
+        return handlerChainAnnotation;
+    }
+
+    public boolean passthrough() {
+        if (this.intf.getHandlerChains() == null) {
+            return true;
+        }
+        return false;
+    }
+
+    public void setJavaInterface(JavaInterface javaInterface) {
+        this.intf = javaInterface;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+
+        if (passthrough()) {
+            return;
+        }
+
+        Element e = this.intf.getHandlerChains();
+        NodeList nl = e.getElementsByTagNameNS(ToolConstants.HANDLER_CHAINS_URI,
+                                               ToolConstants.HANDLER_CHAIN);
+        if (nl.getLength() > 0) {
+            String fName = ProcessorUtil.getHandlerConfigFileName(this.intf.getName());
+            handlerChainAnnotation = new JavaAnnotation("HandlerChain");
+            handlerChainAnnotation.addArgument("name", HANDLER_CHAIN_NAME);
+            handlerChainAnnotation.addArgument("file", fName + ".xml");
+            generateHandlerChainFile(e, parseOutputName(this.intf.getPackageName(),
+                                                        fName,
+                                                        ".xml"));
+        }
+    }
+
+    private void generateHandlerChainFile(Element hChains, Writer writer) throws ToolException {
+        XMLUtils.generateXMLFile(hChains, writer);
+    }
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,86 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.util.Iterator;
+import java.util.Map;
+
+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.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+
+public class ImplGenerator extends AbstractGenerator {
+
+    private static final String IMPL_TEMPLATE = TEMPLATE_BASE + "/impl.vm";
+
+
+    public ImplGenerator() {
+        this.name = ToolConstants.IMPL_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_IMPL)
+                || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        }
+        return true;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        Map<String, JavaServiceClass> services = javaModel.getServiceClasses();
+        String service = "";
+        String port = "";
+        if (!services.values().isEmpty()) {
+            JavaServiceClass javaservice = services.values().iterator().next();
+            service = javaservice.getServiceName();
+            if (javaservice.getPorts().size() != 0) {
+                JavaPort jport = (JavaPort)javaservice.getPorts().get(0);
+                port = jport.getPortName();
+            }
+        }
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+
+            clearAttributes();
+            setAttributes("intf", intf);
+
+            setAttributes("service", service);
+            setAttributes("port", port);
+
+            setCommonAttributes();
+
+            doWrite(IMPL_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Impl"));
+        }
+    }
+
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/JAXWSProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/JAXWSProfile.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/JAXWSProfile.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/JAXWSProfile.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,46 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.tools.common.FrontEndGenerator;
+import org.apache.cxf.tools.common.FrontEndGeneratorsProfile;
+
+/**
+ * Generates a service interface, service stub, and port accessor.
+ *
+ */
+public class JAXWSProfile implements FrontEndGeneratorsProfile {
+    public List<FrontEndGenerator> getPlugins() {
+        List<FrontEndGenerator> plugins = new ArrayList<FrontEndGenerator>();
+
+        plugins.add(new SEIGenerator());
+        plugins.add(new FaultGenerator());
+        plugins.add(new ServerGenerator());
+        plugins.add(new ImplGenerator());
+        plugins.add(new ClientGenerator());
+        plugins.add(new ServiceGenerator());
+        plugins.add(new AntGenerator());
+
+        return plugins;
+    }
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Messages.properties?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Messages.properties (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Messages.properties Wed Sep  6 02:22:36 2006
@@ -0,0 +1,4 @@
+TEMPLATE_MISSING = Can not find velocity tempalte file: {0}
+VELOCITY_ENGINE_WRITE_ERRORS = velocity engin write errors
+FAIL_TO_WRITE_FILE = Failed to write file : {0}
+FAIL_TO_GET_WSDL = Fail to get wsdl url from : {0}
\ No newline at end of file

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,81 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.util.Iterator;
+import java.util.Map;
+
+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.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+
+public class SEIGenerator extends AbstractGenerator {
+
+    private static final String SEI_TEMPLATE = TEMPLATE_BASE + "/sei.vm";
+
+    public SEIGenerator() {
+        this.name = ToolConstants.SEI_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
+            return true;
+        }
+        return false;
+    }
+
+    private boolean hasHandlerConfig(JavaInterface intf) {
+        return intf.getHandlerChains() != null;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+
+            if (hasHandlerConfig(intf)) {
+                HandlerConfigGenerator handlerGen = new HandlerConfigGenerator();
+                //REVISIT: find a better way to handle Handler gen, should not pass JavaInterface around.
+                handlerGen.setJavaInterface(intf);
+                handlerGen.generate(getEnvironment());
+
+                if (handlerGen.getHandlerAnnotation() != null) {
+                    intf.addAnnotation(handlerGen.getHandlerAnnotation().toString());
+                    intf.addImport("javax.jws.HandlerChain");
+                }
+            }
+            clearAttributes();
+            setAttributes("intf", intf);
+            setCommonAttributes();
+
+            doWrite(SEI_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName()));
+        }
+    }
+}
\ No newline at end of file

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,97 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.util.Iterator;
+import java.util.Map;
+
+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.model.JavaInterface;
+import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+
+public class ServerGenerator extends AbstractGenerator {
+
+    private static final String SRV_TEMPLATE = TEMPLATE_BASE + "/server.vm";
+
+    public ServerGenerator() {
+        this.name = ToolConstants.SVR_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_SERVER)
+                || env.optionSet(ToolConstants.CFG_GEN_SERVER)
+                || env.optionSet(ToolConstants.CFG_ALL)) {
+            return false;
+        }
+        return true;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
+        for (Iterator iter = interfaces.keySet().iterator(); iter.hasNext();) {
+            String interfaceName = (String)iter.next();
+            JavaInterface intf = interfaces.get(interfaceName);
+            String address = "";
+
+            Iterator it = javaModel.getServiceClasses().values().iterator();
+            while (it.hasNext()) {
+                JavaServiceClass js = (JavaServiceClass)it.next();
+                Iterator i = js.getPorts().iterator();
+                while (i.hasNext()) {
+                    JavaPort jp = (JavaPort)i.next();
+                    if (interfaceName.equals(jp.getPortType())) {
+                        address = jp.getBindingAdress();
+                        break;
+                    }
+                }
+                if (!"".equals(address)) {
+                    break;
+                }
+            }
+
+
+            String serverClassName = interfaceName + "Server";
+
+            while (isCollision(intf.getPackageName(), serverClassName)) {
+                serverClassName = serverClassName + "_Server";
+            }
+
+            clearAttributes();
+            setAttributes("serverClassName", serverClassName);
+            setAttributes("intf", intf);
+            setAttributes("address", address);
+            setCommonAttributes();
+
+            doWrite(SRV_TEMPLATE, parseOutputName(intf.getPackageName(), serverClassName));
+        }
+    }
+
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,85 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.i18n.Message;
+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.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaServiceClass;
+import org.apache.cxf.tools.util.ProcessorUtil;
+
+public class ServiceGenerator extends AbstractGenerator {
+    private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
+    private static final String SERVICE_TEMPLATE = TEMPLATE_BASE + "/service.vm";
+
+    public ServiceGenerator() {
+        this.name = ToolConstants.SERVICE_GENERATOR;
+    }
+
+    public boolean passthrough() {
+        if (env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
+            return true;
+        }
+        return false;
+    }
+
+    public void generate(ToolContext penv) throws ToolException {
+        this.env = penv;
+        JavaModel javaModel = env.getJavaModel();
+
+        if (passthrough()) {
+            return;
+        }
+
+        Map<String, JavaServiceClass> serviceClasses = javaModel.getServiceClasses();
+
+        Iterator ite = serviceClasses.values().iterator();
+
+        while (ite.hasNext()) {
+
+            JavaServiceClass js = (JavaServiceClass)ite.next();
+
+            String location = (String)env.get(ToolConstants.CFG_WSDLURL);
+            URL url = null;
+            try {
+                url = ProcessorUtil.getWSDLURL(location);
+            } catch (Exception e) {
+                Message message = new Message("FAIL_TO_GET_WSDL", LOG, location);
+                throw new ToolException(message, e);
+            }
+
+            clearAttributes();
+
+            setAttributes("service", js);
+            setAttributes("wsdlLocation", url.toString());
+            setCommonAttributes();
+
+            doWrite(SERVICE_TEMPLATE, parseOutputName(js.getPackageName(), js.getName()));
+        }
+    }
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,67 @@
+/**
+ * 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.wsdl2java.frontend.jaxws;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+public class VelocityWriter extends BufferedWriter {
+    
+    private final String newLine = System.getProperty("line.separator");
+
+    public VelocityWriter(Writer out) {
+        super(out);
+    }
+
+    public VelocityWriter(Writer out, int size) {
+        super(out, size);
+    }
+
+    public void write(char[] chars) throws IOException {
+        String str = new String(chars);
+        if (str.indexOf("\r\n") >= 0 && newLine != null) {
+            super.write(str.replaceAll("\r\n", newLine));
+            return;
+        } else if (str.indexOf("\n") >= 0 && newLine != null) {
+            super.write(str.replaceAll("\n", newLine));
+            return;
+        } else {
+            super.write(str);
+        }
+       
+    }
+   
+    
+    
+    
+    public void write(String str) throws IOException {
+        if (str.indexOf("\r\n") >= 0  && newLine != null) {
+            super.write(str.replaceAll("\r\n", newLine));
+            return;
+        } else if (str.indexOf("\n") >= 0  && newLine != null) {
+            super.write(str.replaceAll("\r\n", newLine));
+            return;
+        } else {
+            super.write(str);
+        }
+    }
+
+}

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

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/build.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/build.vm?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/build.vm (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/build.vm Wed Sep  6 02:22:36 2006
@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+<!-- 
+     Generated by WSDLToJava Compiler. 
+     /**
+     * This class was generated by the cxf $version
+     * $currentdate
+     * Generated source version: $version
+     * 
+     */
+-->
+
+<project name="cxf wsdltojava" default="build" basedir=".">
+    
+    <property environment="env"/>
+    <property name="build.dir" location ="${basedir}/build"/>
+    <property name="build.classes.dir" location ="${build.dir}/classes"/>
+    <property name="build.src.dir" location ="${basedir}"/>
+
+    <!-- find the tools jar, which on darwin, tools.jar does not exist -->
+    <available property="tools.jar" value="$${env.JAVA_HOME}/lib/tools.jar"
+	       file="${env.JAVA_HOME}/lib/tools.jar"/>
+    <path id="jdk.tools.classpath">
+	<pathelement location="${tools.jar}"/>
+    </path>
+
+    <condition property="is.java.version.15">
+	<equals arg1="${ant.java.version}" arg2="1.5"/>
+    </condition>
+
+    <fail message="cxf requires Java version 1.5 or higher. You are currently using Java version ${ant.java.version}."
+	  unless="is.java.version.15"/>
+
+    <!-- Determine cxf.home, either from the environment variable cxf_HOME
+	 - or using ../..
+    -->
+    <condition property="cxf.home" value="${env.cxf_HOME}">
+	<isset property="env.cxf_HOME"/>
+    </condition>
+
+    <fail message="Please set cxf_HOME environment variable." unless="cxf.home"/>
+
+    <!-- Determine cxf.jar.file, either ${cxf.home}/build/lib/cxf.jar
+	 - in a source distribution, or ${cxf.home}/lib/cxf.jar in a binary
+	 - distribution.
+    -->
+    <condition property="cxf.jar.file" value="${cxf.home}/build/lib/cxf.jar">
+	<available file="cxf.jar" type="file" filepath="${cxf.home}/build/lib"/>
+    </condition>
+    <property name="cxf.jar.file" value="${cxf.home}/lib/cxf.jar"/>
+
+    <fail message="The location ${cxf.home} does not seem to contain a cxf installation; if you are importing this common build file from a location other than the cxf samples directory then you need to set the cxf_HOME environment variable.">
+	<condition>
+	    <not>
+		<isset property="cxf.jar.file" />
+	    </not>
+	</condition>
+    </fail>
+
+    <!-- Determine the tools directory, either ${cxf.home}/tools
+	 - in a source distribution, or ${cxf.home}/lib in a binary
+	 - distribution.
+    -->
+    <condition property="thirdparty.tools.dir" value="${cxf.home}/tools">
+	<available file="tools" type="dir" filepath="${cxf.home}"/>
+    </condition>
+
+    <condition property="thirdparty.tools.dir" value="${cxf.home}/lib">
+	<available file="lib" type="dir" filepath="${cxf.home}"/>
+    </condition>
+
+    <property name="cxf.etc.dir" location="${cxf.home}/etc"/>
+
+    <path id="cxf.classpath">
+	<pathelement location="${build.classes.dir}"/>
+	<pathelement location="${cxf.jar.file}"/>
+    </path>
+
+#foreach ($interface in $intfs)
+    <target name="${interface.Name}.Client" description="Run ${interface.Name} client" depends="compile">
+	<property name="param" value=""/>
+	<cxfrun classname="${interface.PackageName}.${interface.Name}Client"
+		   param1="$wsdlLocation"
+		   param2="${op}" 
+		   param3="${param}"/>
+    </target> 
+
+    <target name="${interface.Name}.Server" description="Run ${interface.Name} server" depends="compile">
+	<cxfrun classname="${interface.PackageName}.${interface.Name}Server" 
+		   param1="$wsdlLocation"/>
+    </target>
+#end
+
+
+    <target name="compile">
+	<mkdir dir="${build.classes.dir}"/>
+	<javac srcdir="${build.src.dir}" destdir="${build.classes.dir}" debug="true">
+	    <classpath refid="cxf.classpath" />
+	</javac>
+    </target>
+
+    <target name="checkstyle">
+	<checkstyle config="${checkstyle.config.file}">
+	    <fileset dir="${basedir}/src" includes="**/*.java"/>
+	    <classpath>
+		<path refid="cxf.classpath"/>
+	    </classpath>
+	</checkstyle>
+    </target>
+
+    <target name="clean">
+	<delete dir="${build.classes.dir}"/>
+	<delete file="${java.timestamp.file}"/>
+	<delete file="demo.log"/>
+    </target>
+    
+    <target name="build"  depends="compile" description="build demo client and server"/>
+
+    <macrodef name="cxfrun">
+	<attribute name="classname"/>
+	<attribute name="param1" default=""/>
+	<attribute name="param2" default=""/>
+	<attribute name="param3" default=""/>
+	<attribute name="param4" default=""/>
+	<attribute name="param5" default=""/>
+	<attribute name="jvmarg1" default="-D"/>
+	<attribute name="jvmarg2" default="-D"/>
+	<attribute name="jvmarg3" default="-D"/>
+	<attribute name="jvmarg4" default="-D"/>
+	<attribute name="jvmarg5" default="-D"/>
+	<sequential>
+	    <java classname="@{classname}" fork="yes">
+		<classpath>
+		    <path refid="cxf.classpath"/>
+		</classpath>
+		<arg value="@{param1}"/>
+		<arg value="@{param2}"/>
+		<arg value="@{param3}"/>
+		<arg value="@{param4}"/>
+		<arg value="@{param5}"/>
+		<jvmarg value="@{jvmarg1}"/>
+		<jvmarg value="@{jvmarg2}"/>
+		<jvmarg value="@{jvmarg3}"/>
+		<jvmarg value="@{jvmarg4}"/>
+		<jvmarg value="@{jvmarg5}"/>
+		<assertions>
+		    <enable package="org.apache.cxf"/>
+		</assertions>
+		<sysproperty key="java.util.logging.config.file" value="${cxf.etc.dir}/logging.properties"/>
+		<sysproperty key="log4j.configuration" value="file:///${cxf.etc.dir}/log4j.properties"/>
+	    </java>
+	</sequential>
+    </macrodef>
+</project>

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/client.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/client.vm?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/client.vm (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/client.vm Wed Sep  6 02:22:36 2006
@@ -0,0 +1,74 @@
+/* Generated by WSDLToJava Compiler. */
+package $intf.PackageName;
+
+/**
+ * Please modify this class to meet your needs
+ * This class is not complete
+ */
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+
+/**
+ * This class was generated by the CXF $version
+ * $currentdate
+ * Generated source version: $version
+ * 
+ */
+
+public final class ${clientClassName} {
+
+    private static final QName SERVICE_NAME = new QName("$intf.Namespace", "$service.Name");
+
+    private ${clientClassName}() {
+    }
+
+    public static void main(String args[]) throws Exception {
+
+        if (args.length == 0) { 
+            System.out.println("please specify wsdl");
+            System.exit(1); 
+        }
+        URL wsdlURL = null;
+        File wsdlFile = new File(args[0]);
+        try {
+            if (wsdlFile.exists()) {
+                wsdlURL = wsdlFile.toURL();
+            } else {
+                wsdlURL = new URL(args[0]);
+            }
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        }
+      
+        $service.Name ss = new ${service.Name}(wsdlURL, SERVICE_NAME);
+        $intf.Name port = ss.get${port.Name}();  
+        
+#foreach ($method in $intf.Methods)
+
+        System.out.println("Invoking ${method.Name}...");
+#if($method.Exceptions.size() > 0)
+        try{
+            #if($method.return.Type != "void")
+            $method.return.ClassName _${method.Name}_$method.return.Name=#end  port.${method.Name}(#foreach ($parameter in $method.Parameters) ${parameter.DefaultTypeValue}  #if ($velocityCount != $method.parameterCount) , #end #end);
+            #if($method.return.Type != "void")
+            System.out.println("${method.Name}.result=" + _${method.Name}_$method.return.Name);
+            #end
+        }#foreach($exception in $method.Exceptions)
+        catch($exception.ClassName e){ 
+        System.out.println("Expected exception: $exception.Name has occurred.");
+        System.out.println(e.toString());
+        }#end
+        #else
+        #if($method.return.ClassName != "void")$method.return.ClassName _${method.Name}_$method.return.Name =#end port.${method.Name}(#foreach($parameter in $method.Parameters)${parameter.DefaultTypeValue}#if($velocityCount != $method.parameterCount),#end#end);
+#end#if($method.return.Type != "void")
+        #end
+#end
+        
+        
+        System.exit(0);
+    }
+
+}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/fault.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/fault.vm?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/fault.vm (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/fault.vm Wed Sep  6 02:22:36 2006
@@ -0,0 +1,42 @@
+/* Generated by WSDLToJava Compiler. */
+
+package $expClass.PackageName;
+
+import javax.xml.ws.WebFault;
+
+
+/**
+ * This class was generated by the CXF $version
+ * $currentdate
+ * Generated source version: $version
+ * 
+ */
+
+#foreach ($field in $expClass.Fields)
+@WebFault(name = "$field.Name", targetNamespace = "$field.TargetNamespace")
+#end
+
+public class $expClass.Name extends Exception {
+#foreach ($field in $expClass.Fields)
+    
+    $field.Modifier $field.ClassName $paraName;
+
+    public $expClass.Name (String message) {
+        super(message);
+    }
+
+    public $expClass.Name (String message, $field.ClassName $paraName) {
+        super(message);
+        this.$paraName = $paraName;
+    }
+
+    public $expClass.Name (String message, $field.ClassName $paraName, Throwable cause) {
+        super(message, cause);
+        this.$paraName = $paraName;
+    }
+
+    public $field.ClassName getFaultInfo() {
+        return this.$paraName;
+    }
+#end
+}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/impl.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/impl.vm?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/impl.vm (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/impl.vm Wed Sep  6 02:22:36 2006
@@ -0,0 +1,59 @@
+/* Generated by WSDLToJava Compiler. */
+
+/**
+ * Please modify this class to meet your needs
+ * This class is not complete
+ */
+
+package $intf.PackageName;
+
+import java.util.logging.Logger;
+#foreach ($import in $intf.Imports)
+import ${import};
+#end
+
+/**
+ * This class was generated by the CXF $version
+ * $currentdate
+ * Generated source version: $version
+ * 
+ */
+
+@javax.jws.WebService(name = "$intf.Name", serviceName = "$service",
+                      portName = "$port",
+                      targetNamespace = "$intf.Namespace", 
+                      wsdlLocation = "$intf.Location")
+                      
+public class ${intf.Name}Impl implements $intf.Name {
+
+    private static final Logger LOG = 
+        Logger.getLogger(${intf.Name}Impl.class.getPackage().getName());
+
+#foreach ($method in $intf.Methods)
+    /* (non-Javadoc)
+     * @see $intf.PackageName.$intf.Name#${method.Name}(#foreach ($parameter in $method.Parameters)$parameter.ClassName  $parameter.Name #if ($velocityCount != $method.getParameters().size()),#end)#end*
+     */
+    public $method.return.ClassName ${method.Name}(#if($method.ParameterListWithoutAnnotation.size() == 0))#end
+#if($method.ParameterListWithoutAnnotation.size() != 0)
+
+#foreach ($param in ${method.ParameterListWithoutAnnotation})
+        $param
+#end
+    )#end
+
+###foreach ($parameter in $method.Parameters)$parameter.ClassName  _$parameter.Name #if ($velocityCounter != $method.getParameters().size()),#end#end)
+#if($method.Exceptions.size() > 0) throws #foreach($exception in $method.Exceptions)$exception.ClassName #if($velocityCount != $method.Exceptions.size()),#end #end #end
+    { 
+       LOG.info("Executing operation $method.Name");
+#if ($method.return.ClassName != "void")    ##
+    return ${method.return.DefaultTypeValue};
+#end
+#if ($method.Exceptions.size() > 0) 
+#foreach($exception in $method.Exceptions)
+    //throw new ${exception.ClassName}("${exception.Name}...");
+#end
+#end
+    }
+
+#end
+}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/sei.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/sei.vm?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/sei.vm (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/sei.vm Wed Sep  6 02:22:36 2006
@@ -0,0 +1,39 @@
+/* Generated by WSDLToJava Compiler. */
+
+package $intf.PackageName;
+
+import javax.jws.WebParam.Mode;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.jws.soap.SOAPBinding;
+#foreach ($import in $intf.Imports)
+import ${import};
+#end
+
+/**
+ * This class was generated by the CXF $version
+ * $currentdate
+ * Generated source version: $version
+ * 
+ */
+
+#foreach ($annotation in $intf.Annotations)
+$annotation
+#end
+
+public interface $intf.Name {
+#foreach ($method in $intf.Methods)
+
+#foreach ($annotation in $method.Annotations)
+    $annotation
+#end
+    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;
+#end
+}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/server.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/server.vm?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/server.vm (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/server.vm Wed Sep  6 02:22:36 2006
@@ -0,0 +1,30 @@
+/* Generated by WSDLToJava Compiler. */
+package $intf.PackageName;
+
+import javax.xml.ws.Endpoint;
+
+/**
+ * This class was generated by the CXF $version
+ * $currentdate
+ * Generated source version: $version
+ * 
+ */
+ 
+public class ${serverClassName}{
+
+    protected ${serverClassName}() throws Exception {
+        System.out.println("Starting Server");
+        Object implementor = new ${intf.Name}Impl();
+        String address = "${address}";
+        Endpoint.publish(address, implementor);
+    }
+    
+    public static void main(String args[]) throws Exception { 
+        new ${serverClassName}();
+        System.out.println("Server ready..."); 
+        
+        Thread.sleep(5 * 60 * 1000); 
+        System.out.println("Server exitting");
+        System.exit(0);
+    }
+}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/service.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/service.vm?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/service.vm (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/service.vm Wed Sep  6 02:22:36 2006
@@ -0,0 +1,57 @@
+package $service.PackageName;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+#foreach ($port in ${service.Ports})    
+import ${port.PackageName}.${port.InterfaceClass};
+#end
+/**
+ * This class was generated by the CXF $version
+ * $currentdate
+ * Generated source version: $version
+ * 
+ */
+
+@WebServiceClient(name = "${service.ServiceName}", targetNamespace = "$service.Namespace", wsdlLocation = "$wsdlLocation")
+public class ${service.Name} extends Service {
+
+    private final static URL WSDL_LOCATION;
+    private final static QName SERVICE = new QName("$service.Namespace", "$service.ServiceName");
+#foreach ($port in ${service.Ports})
+    private final static QName $port.Name = new QName("$service.Namespace", "$port.PortName");
+#end
+    static {
+        URL url = null;
+        try {
+            url = new URL("$wsdlLocation");
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        }
+        WSDL_LOCATION = url;
+    }
+
+    public ${service.Name}(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public ${service.Name}() {
+        super(WSDL_LOCATION, SERVICE);
+    }
+
+#foreach ($port in $service.Ports)
+    /**
+     * 
+     * @return
+     *     returns ${port.Name}
+     */
+    @WebEndpoint(name = "${port.PortName}")
+    public ${port.InterfaceClass} get${port.Name}() {
+        return (${port.InterfaceClass})super.getPort($port.Name, ${port.InterfaceClass}.class);
+    }
+#end
+
+}
\ No newline at end of file

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java Wed Sep  6 02:22:36 2006
@@ -35,14 +35,14 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.tools.common.PluginProfile;
+import org.apache.cxf.tools.common.FrontEndGeneratorsProfile;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.extensions.jaxws.CustomizationParser;
 import org.apache.cxf.tools.common.extensions.jaxws.JAXWSBinding;
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.util.ClassCollector;
-import org.apache.cxf.tools.wsdl2java.generator.jaxws.JAXWSProfile;
+import org.apache.cxf.tools.wsdl2java.frontend.jaxws.JAXWSProfile;
 import org.apache.cxf.tools.wsdl2java.processor.compiler.Compiler;
 import org.apache.cxf.tools.wsdl2java.processor.internal.PortTypeProcessor;
 import org.apache.cxf.tools.wsdl2java.processor.internal.SEIAnnotationProcessor;
@@ -142,9 +142,9 @@
             profile = JAXWSProfile.class.getName();
         }
 
-        PluginProfile profileObj = null;
+        FrontEndGeneratorsProfile profileObj = null;
         try {
-            profileObj = (PluginProfile) Class.forName(profile).newInstance();
+            profileObj = (FrontEndGeneratorsProfile) Class.forName(profile).newInstance();
         } catch (Exception e) {
             Message msg = new Message("FAIl_TO_CREATE_PLUGINPROFILE", LOG);
             throw new ToolException(msg);

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java Wed Sep  6 02:22:36 2006
@@ -53,17 +53,17 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.WSDLHelper;
 import org.apache.cxf.tools.common.DataBindingGenerator;
-import org.apache.cxf.tools.common.GeneratorPlugin;
+import org.apache.cxf.tools.common.FrontEndGenerator;
 import org.apache.cxf.tools.common.Processor;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.extensions.jaxws.CustomizationParser;
 import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.util.FileWriterUtil;
 import org.apache.cxf.tools.util.WSDLExtensionRegister;
 import org.apache.cxf.tools.validator.internal.WSDL11Validator;
-import org.apache.cxf.tools.wsdl2java.generator.jaxb.JAXBBindingGenerator;
+import org.apache.cxf.tools.wsdl2java.databindings.jaxb.JAXBBindingGenerator;
 import org.apache.velocity.app.Velocity;
 
 public class WSDLToProcessor implements Processor {
@@ -71,7 +71,7 @@
     protected static final String WSDL_FILE_NAME_EXT = ".wsdl";
 
     protected Definition wsdlDefinition;
-    protected ProcessorEnvironment env;
+    protected ToolContext env;
     protected WSDLFactory wsdlFactory;
     protected WSDLReader wsdlReader;
     protected S2JJAXBModel rawJaxbModel;
@@ -82,7 +82,7 @@
     protected List<String> excludeGenFiles;
     protected Map<QName, Service> importedServices = new java.util.HashMap<QName, Service>();
     protected Map<QName, PortType> importedPortTypes = new java.util.HashMap<QName, PortType>();
-    protected List<GeneratorPlugin> generators;
+    protected List<FrontEndGenerator> generators;
 
     //  For process nestedJaxbBinding
     protected boolean nestedJaxbBinding;
@@ -376,16 +376,16 @@
     }
 
     protected void doGeneration() throws ToolException {
-        for (GeneratorPlugin plugin : generators) {
+        for (FrontEndGenerator plugin : generators) {
             plugin.generate(env);
         }
     }
 
-    public void setEnvironment(ProcessorEnvironment penv) {
+    public void setEnvironment(ToolContext penv) {
         this.env = penv;
     }
 
-    public ProcessorEnvironment getEnvironment() {
+    public ToolContext getEnvironment() {
         return this.env;
     }
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java Wed Sep  6 02:22:36 2006
@@ -23,19 +23,19 @@
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.tools.common.DataBindingGenerator;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.util.ClassCollector;
 
 public abstract class AbstractProcessor {
     protected static final Logger LOG = LogUtils.getL7dLogger(AbstractProcessor.class);
-    protected ProcessorEnvironment env;
+    protected ToolContext env;
     
     protected ClassCollector  collector;
     
     protected DataBindingGenerator dataBinder;
     
-    public AbstractProcessor(ProcessorEnvironment penv) {
+    public AbstractProcessor(ToolContext penv) {
         this.env = penv;
         this.collector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
         dataBinder = (DataBindingGenerator)env.get(ToolConstants.BINDING_GENERATOR);

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java Wed Sep  6 02:22:36 2006
@@ -26,7 +26,7 @@
 import javax.wsdl.Message;
 import javax.wsdl.Part;
 
-import org.apache.cxf.tools.common.ProcessorEnvironment;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaException;
 import org.apache.cxf.tools.common.model.JavaExceptionClass;
@@ -38,7 +38,7 @@
 public class FaultProcessor extends AbstractProcessor {
 
    
-    public FaultProcessor(ProcessorEnvironment penv) {
+    public FaultProcessor(ToolContext penv) {
       super(penv);
     }
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/JAXBBindingMerger.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/JAXBBindingMerger.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/JAXBBindingMerger.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/JAXBBindingMerger.java Wed Sep  6 02:22:36 2006
@@ -34,15 +34,15 @@
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.ProcessorUtil;
 
 public class JAXBBindingMerger {   
     protected static final Logger LOG = LogUtils.getL7dLogger(JAXBBindingMerger.class);
     private boolean merged;
-    public void mergeJaxwsBinding(Element schema, ProcessorEnvironment env) {
+    public void mergeJaxwsBinding(Element schema, ToolContext env) {
         String[] bindingFiles;
         try {
             bindingFiles = (String[])env.get(ToolConstants.CFG_BINDING);

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/MIMEProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/MIMEProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/MIMEProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/MIMEProcessor.java Wed Sep  6 02:22:36 2006
@@ -28,7 +28,7 @@
 import javax.wsdl.extensions.mime.MIMEPart;
 
 import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
@@ -37,7 +37,7 @@
 
 public class MIMEProcessor extends AbstractProcessor {
 
-    public MIMEProcessor(ProcessorEnvironment penv) {
+    public MIMEProcessor(ToolContext penv) {
         super(penv);
     }
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java Wed Sep  6 02:22:36 2006
@@ -34,8 +34,8 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.extensions.jaxws.CustomizationParser;
 import org.apache.cxf.tools.common.extensions.jaxws.JAXWSBinding;
@@ -52,7 +52,7 @@
     private JavaParameter wrapperRequest;
     private JavaParameter wrapperResponse;
 
-    public OperationProcessor(ProcessorEnvironment penv) {
+    public OperationProcessor(ToolContext penv) {
         super(penv);
     }
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java Wed Sep  6 02:22:36 2006
@@ -34,7 +34,7 @@
 import com.sun.codemodel.JType;
 import com.sun.tools.xjc.api.Property;
 
-import org.apache.cxf.tools.common.ProcessorEnvironment;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
@@ -45,7 +45,7 @@
 
 public class ParameterProcessor extends AbstractProcessor {
    
-    public ParameterProcessor(ProcessorEnvironment penv) {      
+    public ParameterProcessor(ToolContext penv) {      
            super(penv);
     }
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/PortTypeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/PortTypeProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/PortTypeProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/PortTypeProcessor.java Wed Sep  6 02:22:36 2006
@@ -28,22 +28,19 @@
 import javax.wsdl.PortType;
 
 import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.extensions.jaxws.CustomizationParser;
 import org.apache.cxf.tools.common.extensions.jaxws.JAXWSBinding;
-
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaModel;
-
 import org.apache.cxf.tools.util.ProcessorUtil;
 
 public class PortTypeProcessor extends AbstractProcessor {
     private List<String> operationMap = new ArrayList<String>();
     
-    public PortTypeProcessor(ProcessorEnvironment penv) {
+    public PortTypeProcessor(ToolContext penv) {
         super(penv);
     }
     

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/SEIAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/SEIAnnotationProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/SEIAnnotationProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/SEIAnnotationProcessor.java Wed Sep  6 02:22:36 2006
@@ -23,7 +23,7 @@
 import javax.jws.soap.SOAPBinding;
 import javax.wsdl.Definition;
 
-import org.apache.cxf.tools.common.ProcessorEnvironment;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
@@ -32,7 +32,7 @@
 
 public class SEIAnnotationProcessor extends AbstractProcessor {
 
-    public SEIAnnotationProcessor(ProcessorEnvironment penv) {
+    public SEIAnnotationProcessor(ToolContext penv) {
         super(penv);
     }
     

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java Wed Sep  6 02:22:36 2006
@@ -47,8 +47,8 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.extensions.jaxws.CustomizationParser;
 import org.apache.cxf.tools.common.extensions.jaxws.JAXWSBinding;
@@ -86,11 +86,11 @@
 
     private Object bindingObj;
 
-    public ServiceProcessor(ProcessorEnvironment penv) {
+    public ServiceProcessor(ToolContext penv) {
         super(penv);
     }
 
-    public ServiceProcessor(ProcessorEnvironment penv, Definition def) {
+    public ServiceProcessor(ToolContext penv, Definition def) {
         super(penv);
         this.definition = def;
     }

Modified: incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java Wed Sep  6 02:22:36 2006
@@ -32,7 +32,7 @@
 public class ProcessorTestBase extends TestCase {
 
     private static final int RETRY_SLEEP_MILLIS = 10;
-    protected ProcessorEnvironment env = new ProcessorEnvironment();
+    protected ToolContext env = new ToolContext();
     protected File output;
 
     public void setUp() throws Exception {



Mime
View raw message