cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r571401 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/tools/common/ tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/ tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/ tools/javato/ws/src/main/j...
Date Fri, 31 Aug 2007 08:38:51 GMT
Author: ema
Date: Fri Aug 31 01:38:50 2007
New Revision: 571401

URL: http://svn.apache.org/viewvc?rev=571401&view=rev
Log:
* Clean up generators for simple frontend
* Added the function to jump the generator according to provided flags 

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleFrontEndProcessor.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleSEIGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/server.vm
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
    incubator/cxf/trunk/tools/javato/ws/src/test/resources/java2wsdl_wsdl/doc_wrapped_simple.wsdl

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java Fri
Aug 31 01:38:50 2007
@@ -213,4 +213,7 @@
     //For java2ws tool
     public static final String SERVICE_LIST = "serviceList";
     public static final String GEN_FROM_SEI = "genFromSEI";
+    //For Simple FrontEnd
+    public static final String SEI_CLASS = "seiClass";
+    public static final String IMPL_CLASS = "implClass";
 }

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
Fri Aug 31 01:38:50 2007
@@ -63,6 +63,7 @@
                 String ft = (String)env.get(ToolConstants.CFG_FRONTEND);
                 if (ft == null || "jaxws".equals(ft.toLowerCase())) {
                     ft = "jaxws";
+                    env.put(ToolConstants.CFG_FRONTEND, "jaxws");
                     if (env.optionSet(ToolConstants.CFG_SERVER) || env.optionSet(ToolConstants.CFG_CLIENT))
{
                         processor = new ServiceInfoToJavaProcessor();
                         processor.setEnvironment(env);
@@ -70,6 +71,7 @@
                     }
                 } else {
                     ft = "simple";
+                    env.put(ToolConstants.CFG_FRONTEND, "simple");
                     processor = new SimpleFrontEndProcessor();
                     processor.setEnvironment(env);
                     processor.process();

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
Fri Aug 31 01:38:50 2007
@@ -145,8 +145,13 @@
         Class<?> clz = getServiceClass();
         context.put(Class.class, clz);
         if (clz.isInterface()) {
-            context.put(ToolConstants.GEN_FROM_SEI, Boolean.TRUE);   
+            context.put(ToolConstants.GEN_FROM_SEI, Boolean.TRUE);
+            context.put(ToolConstants.SEI_CLASS, clz);
         } else {
+            context.put(ToolConstants.IMPL_CLASS, clz);
+            if (clz.getInterfaces().length == 1) {
+                context.put(ToolConstants.SEI_CLASS, clz.getInterfaces()[0].getName());
+            }
             context.put(ToolConstants.GEN_FROM_SEI, Boolean.FALSE); 
         }
         builderFactory.setServiceClass(clz);

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleFrontEndProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleFrontEndProcessor.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleFrontEndProcessor.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/SimpleFrontEndProcessor.java
Fri Aug 31 01:38:50 2007
@@ -22,6 +22,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
@@ -39,6 +40,7 @@
 import org.apache.cxf.tools.common.model.JavaParameter;
 import org.apache.cxf.tools.common.model.JavaReturn;
 import org.apache.cxf.tools.common.model.JavaType.Style;
+import org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.AbstractSimpleGenerator;
 import org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleClientGenerator;
 import org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleImplGenerator;
 import org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleSEIGenerator;
@@ -46,6 +48,7 @@
 
 public class SimpleFrontEndProcessor implements Processor {
     private ToolContext context;
+    private List<AbstractSimpleGenerator> generators = new ArrayList<AbstractSimpleGenerator>();
     @SuppressWarnings("unchecked")
     public void process() throws ToolException {       
         List<ServiceInfo> services = (List<ServiceInfo>)context.get(ToolConstants.SERVICE_LIST);
@@ -55,14 +58,15 @@
         jm.addInterface("inf", jinf);
         jinf.setJavaModel(jm);
         context.put(JavaModel.class, jm);
-        SimpleSEIGenerator seiGenerator = new SimpleSEIGenerator();
-        seiGenerator.generate(context);
-        SimpleImplGenerator implGenerator = new SimpleImplGenerator();
-        implGenerator.generate(context);
-        SimpleServerGenerator svrGenerator = new SimpleServerGenerator();
-        svrGenerator.generate(context);
-        SimpleClientGenerator clientGenerator = new SimpleClientGenerator();
-        clientGenerator.generate(context);
+        generators.add(new SimpleSEIGenerator());
+        generators.add(new SimpleImplGenerator());
+        generators.add(new SimpleServerGenerator());
+        generators.add(new SimpleClientGenerator());
+        
+        for (AbstractSimpleGenerator generator : generators) {
+            generator.generate(context);
+        }
+
     }
     
     public void setEnvironment(ToolContext env) {

Modified: incubator/cxf/trunk/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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java
Fri Aug 31 01:38:50 2007
@@ -34,8 +34,8 @@
     public abstract boolean passthrough();
 
     public abstract void generate(ToolContext penv) throws ToolException;
-
     public void register(final ClassCollector collector, String packageName, String fileName)
{
-        // do nothing
+        
     }
+
 }

Modified: incubator/cxf/trunk/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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleClientGenerator.java
Fri Aug 31 01:38:50 2007
@@ -20,14 +20,11 @@
 
 import java.util.Map;
 
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.service.model.ServiceInfo;
 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.util.ClassCollector;
 
 public class SimpleClientGenerator extends AbstractSimpleGenerator {
 
@@ -38,17 +35,10 @@
     }
 
     public boolean passthrough() {
-        /*if (env.optionSet(ToolConstants.CFG_GEN_SEI) || env.optionSet(ToolConstants.CFG_ALL))
{
+        if (env.optionSet(ToolConstants.CFG_CLIENT)) {
             return false;
         }
-        if (env.optionSet(ToolConstants.CFG_GEN_ANT) || env.optionSet(ToolConstants.CFG_GEN_TYPES)
-            || env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_IMPL)
-            || env.optionSet(ToolConstants.CFG_GEN_SERVER) || env.optionSet(ToolConstants.CFG_GEN_SERVICE)
-            || env.optionSet(ToolConstants.CFG_GEN_FAULT)) {
-            return true;
-        }*/
-
-        return false;
+        return true;
 
     }
 
@@ -56,33 +46,20 @@
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
         JavaModel javaModel = env.get(JavaModel.class);
-
+        
         if (passthrough()) {
             return;
         }
-
+        
         Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
 
-        if (interfaces.size() == 0) {
-            ServiceInfo serviceInfo = (ServiceInfo)env.get(ServiceInfo.class);
-            String wsdl = serviceInfo.getDescription().getBaseURI();
-            Message msg = new Message("CAN_NOT_GEN_SEI", LOG, wsdl);
-            if (penv.isVerbose()) {
-                System.out.println(msg.toString());
-            }
-            return;
-        }
         for (JavaInterface intf : interfaces.values()) {
             clearAttributes();
             setAttributes("intf", intf);
+            setAttributes("seiClass", ((Class)env.get(ToolConstants.SEI_CLASS)).getName());
             setCommonAttributes();
-
             doWrite(CLIENT_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName()
+ "Client"));
 
         }
-    }
-
-    public void register(final ClassCollector collector, String packageName, String fileName)
{
-        
     }
 }

Modified: incubator/cxf/trunk/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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleImplGenerator.java
Fri Aug 31 01:38:50 2007
@@ -20,14 +20,11 @@
 
 import java.util.Map;
 
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.service.model.ServiceInfo;
 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.util.ClassCollector;
 
 public class SimpleImplGenerator extends AbstractSimpleGenerator {
 
@@ -38,17 +35,13 @@
     }
 
     public boolean passthrough() {
-        /*if (env.optionSet(ToolConstants.CFG_GEN_SEI) || env.optionSet(ToolConstants.CFG_ALL))
{
+        Boolean genFromSei = (Boolean)env.get(ToolConstants.GEN_FROM_SEI);
+        if (genFromSei && env.optionSet(ToolConstants.CFG_SERVER) 
+            && (!env.optionSet(ToolConstants.IMPL_CLASS))) {
             return false;
         }
-        if (env.optionSet(ToolConstants.CFG_GEN_ANT) || env.optionSet(ToolConstants.CFG_GEN_TYPES)
-            || env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_IMPL)
-            || env.optionSet(ToolConstants.CFG_GEN_SERVER) || env.optionSet(ToolConstants.CFG_GEN_SERVICE)
-            || env.optionSet(ToolConstants.CFG_GEN_FAULT)) {
-            return true;
-        }*/
 
-        return false;
+        return true;
 
     }
 
@@ -56,33 +49,21 @@
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
         JavaModel javaModel = env.get(JavaModel.class);
-
+        
         if (passthrough()) {
             return;
-        }
-
+        }      
+        
         Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
 
-        if (interfaces.size() == 0) {
-            ServiceInfo serviceInfo = (ServiceInfo)env.get(ServiceInfo.class);
-            String wsdl = serviceInfo.getDescription().getBaseURI();
-            Message msg = new Message("CAN_NOT_GEN_SEI", LOG, wsdl);
-            if (penv.isVerbose()) {
-                System.out.println(msg.toString());
-            }
-            return;
-        }
         for (JavaInterface intf : interfaces.values()) {
             clearAttributes();
             setAttributes("intf", intf);
             setCommonAttributes();
 
             doWrite(IMPL_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName()
+ "Impl"));
-
+            env.put(ToolConstants.IMPL_CLASS, intf.getFullClassName() + "Impl");
         }
     }
 
-    public void register(final ClassCollector collector, String packageName, String fileName)
{
-        
-    }
 }

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleSEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleSEIGenerator.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleSEIGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleSEIGenerator.java
Fri Aug 31 01:38:50 2007
@@ -20,14 +20,11 @@
 
 import java.util.Map;
 
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.service.model.ServiceInfo;
 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.util.ClassCollector;
 
 public class SimpleSEIGenerator extends AbstractSimpleGenerator {
 
@@ -38,17 +35,12 @@
     }
 
     public boolean passthrough() {
-        /*if (env.optionSet(ToolConstants.CFG_GEN_SEI) || env.optionSet(ToolConstants.CFG_ALL))
{
+        Boolean genFromSei = (Boolean)env.get(ToolConstants.GEN_FROM_SEI);
+        if (!genFromSei && env.optionSet(ToolConstants.CFG_CLIENT)
+            && (!env.optionSet(ToolConstants.SEI_CLASS))) {
             return false;
         }
-        if (env.optionSet(ToolConstants.CFG_GEN_ANT) || env.optionSet(ToolConstants.CFG_GEN_TYPES)
-            || env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_IMPL)
-            || env.optionSet(ToolConstants.CFG_GEN_SERVER) || env.optionSet(ToolConstants.CFG_GEN_SERVICE)
-            || env.optionSet(ToolConstants.CFG_GEN_FAULT)) {
-            return true;
-        }*/
-
-        return false;
+        return true;
 
     }
 
@@ -56,33 +48,22 @@
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
         JavaModel javaModel = env.get(JavaModel.class);
-
+        
         if (passthrough()) {
             return;
         }
-
+        
         Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
 
-        if (interfaces.size() == 0) {
-            ServiceInfo serviceInfo = (ServiceInfo)env.get(ServiceInfo.class);
-            String wsdl = serviceInfo.getDescription().getBaseURI();
-            Message msg = new Message("CAN_NOT_GEN_SEI", LOG, wsdl);
-            if (penv.isVerbose()) {
-                System.out.println(msg.toString());
-            }
-            return;
-        }
         for (JavaInterface intf : interfaces.values()) {
             clearAttributes();
             setAttributes("intf", intf);
             setCommonAttributes();
 
             doWrite(SEI_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName()));
-
+            env.put(ToolConstants.SEI_CLASS, intf.getFullClassName());
         }
     }
 
-    public void register(final ClassCollector collector, String packageName, String fileName)
{
-        
-    }
+
 }

Modified: incubator/cxf/trunk/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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/SimpleServerGenerator.java
Fri Aug 31 01:38:50 2007
@@ -21,14 +21,11 @@
 
 import java.util.Map;
 
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.service.model.ServiceInfo;
 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.util.ClassCollector;
 
 /**
  * 
@@ -42,52 +39,30 @@
     }
 
     public boolean passthrough() {
-        /*if (env.optionSet(ToolConstants.CFG_GEN_SEI) || env.optionSet(ToolConstants.CFG_ALL))
{
+        if (env.optionSet(ToolConstants.CFG_SERVER)) {
             return false;
         }
-        if (env.optionSet(ToolConstants.CFG_GEN_ANT) || env.optionSet(ToolConstants.CFG_GEN_TYPES)
-            || env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_IMPL)
-            || env.optionSet(ToolConstants.CFG_GEN_SERVER) || env.optionSet(ToolConstants.CFG_GEN_SERVICE)
-            || env.optionSet(ToolConstants.CFG_GEN_FAULT)) {
-            return true;
-        }*/
-
-        return false;
-
+        return true;
     }
 
-
     public void generate(ToolContext penv) throws ToolException {
+
         this.env = penv;
         JavaModel javaModel = env.get(JavaModel.class);
-
+        
         if (passthrough()) {
             return;
         }
 
         Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
 
-        if (interfaces.size() == 0) {
-            ServiceInfo serviceInfo = (ServiceInfo)env.get(ServiceInfo.class);
-            String wsdl = serviceInfo.getDescription().getBaseURI();
-            Message msg = new Message("CAN_NOT_GEN_SEI", LOG, wsdl);
-            if (penv.isVerbose()) {
-                System.out.println(msg.toString());
-            }
-            return;
-        }
         for (JavaInterface intf : interfaces.values()) {
             clearAttributes();
             setAttributes("intf", intf);
-            setAttributes("implClass", intf.getFullClassName() + "Impl");
+            setAttributes("implClass", ((Class)env.get(ToolConstants.IMPL_CLASS)).getName());
             setCommonAttributes();
-
             doWrite(SERVER_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName()
+ "Server"));
-
         }
     }
 
-    public void register(final ClassCollector collector, String packageName, String fileName)
{
-        
-    }
-}
\ No newline at end of file
+}

Modified: incubator/cxf/trunk/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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/client.vm
Fri Aug 31 01:38:50 2007
@@ -27,7 +27,7 @@
 
 /**
  * This cla  ss was generated by the CXF $version
- * $curr  entdate
+ * $currentdate
  * Generated source version: $version
  * 
  */
@@ -38,7 +38,7 @@
         clientBean.setAddress("http://localhost:8088/Hello");
         clientBean.setBus(CXFBusFactory.getDefaultBus());
         clientBean.setTransportId("http://schemas.xmlsoap.org/wsdl/http/");
-        clientBean.setServiceClass(${inf.ClassName}.class);
+        clientBean.setServiceClass(${seiClass}.class);
         proxyFactory.getServiceFactory().setDataBinding(new AegisDatabinding());
         ${intf.FullClassName} client = (${intf.FullClassName})proxyFactory.create();
     }

Modified: incubator/cxf/trunk/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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/impl.vm
Fri Aug 31 01:38:50 2007
@@ -24,7 +24,7 @@
 
 /**
  * This cla  ss was generated by the CXF $version
- * $curr  entdate
+ * $currentdate
  * Generated source version: $version
  * 
  */

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/server.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/server.vm?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/server.vm
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/template/server.vm
Fri Aug 31 01:38:50 2007
@@ -27,7 +27,7 @@
 
 /**
  * This cla  ss was generated by the CXF $version
- * $curr  entdate
+ * $currentdate
  * Generated source version: $version
  * 
  */

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
Fri Aug 31 01:38:50 2007
@@ -74,6 +74,7 @@
         String[] args = new String[] {"-wsdl", "-o", output.getPath() + "/tmp.wsdl", "-verbose",
                                       "-d", output.getPath(),
                                       "-frontend", "simple",
+                                      "-client",
                                       "org.apache.hello_world_doc_lit.Greeter"};
         JavaToWS.main(args);
         File wsdlFile = new File(output.getPath() + "/tmp.wsdl");

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/resources/java2wsdl_wsdl/doc_wrapped_simple.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/resources/java2wsdl_wsdl/doc_wrapped_simple.wsdl?rev=571401&r1=571400&r2=571401&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/resources/java2wsdl_wsdl/doc_wrapped_simple.wsdl
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/resources/java2wsdl_wsdl/doc_wrapped_simple.wsdl
Fri Aug 31 01:38:50 2007
@@ -1,69 +1,82 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  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.
+	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.
 -->
-<wsdl:definitions xmlns:tns="http://docwrapped.iona.com/" xmlns:ns1="http://docwrapped.iona.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://docwrapped.iona.com/"
xmlns:x1="http://docwrapped.iona.com/jaxws">
+<wsdl:definitions xmlns:tns="http://docwrapped.iona.com/"
+	xmlns:ns1="http://docwrapped.iona.com/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	targetNamespace="http://docwrapped.iona.com/"
+	xmlns:x1="http://docwrapped.iona.com/jaxws">
 	<wsdl:types>
-		<schema targetNamespace="http://docwrapped.iona.com/jaxws" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
-	
+		<schema targetNamespace="http://docwrapped.iona.com/jaxws"
+			xmlns="http://www.w3.org/2001/XMLSchema"
+			xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
 			<element name="getPrice">
-			    <complexType>
-			       <sequence>
-			          <element name="responseType" type="xs:string"/>
-			       </sequence>
-			     </complexType>
-                        </element>
+				<complexType>
+					<sequence>
+						<element name="requestType" type="xs:string" />
+					</sequence>
+				</complexType>
+			</element>
 			<element name="getPriceResponse">
-		            <complexType>
-				<sequence>
-					<element name="responseType" type="xs:float"/>
-				</sequence>
-			    </complexType>
-                        </element>
+				<complexType>
+					<sequence>
+						<element name="responseType" type="xs:float" />
+					</sequence>
+				</complexType>
+			</element>
 		</schema>
 	</wsdl:types>
 	<wsdl:message name="getPrice">
-		<wsdl:part name="getPrice" element="x1:getPrice"/>
+		<wsdl:part name="getPrice" element="x1:getPrice" />
 	</wsdl:message>
 	<wsdl:message name="getPriceResponse">
-		<wsdl:part name="getPriceResponse" element="x1:getPriceResponse"/>
+		<wsdl:part name="getPriceResponse"
+			element="x1:getPriceResponse" />
 	</wsdl:message>
 	<wsdl:portType name="StockPortType">
 		<wsdl:operation name="getPrice">
-			<wsdl:input name="getPrice" message="tns:getPrice"/>
-			<wsdl:output name="getPriceResponse" message="tns:getPriceResponse"/>
+			<wsdl:input name="getPrice" message="tns:getPrice" />
+			<wsdl:output name="getPriceResponse"
+				message="tns:getPriceResponse" />
 		</wsdl:operation>
 	</wsdl:portType>
-	<wsdl:binding name="StockPortTypeBinding" type="tns:StockPortType">
-		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+	<wsdl:binding name="StockPortTypeBinding"
+		type="tns:StockPortType">
+		<soap:binding style="document"
+			transport="http://schemas.xmlsoap.org/soap/http" />
 		<wsdl:operation name="getPrice">
-			<soap:operation style="document"/>
+			<soap:operation style="document" />
 			<wsdl:input>
-				<soap:body use="literal"/>
+				<soap:body use="literal" />
 			</wsdl:input>
 			<wsdl:output>
-				<soap:body use="literal"/>
+				<soap:body use="literal" />
 			</wsdl:output>
 		</wsdl:operation>
 	</wsdl:binding>
 	<wsdl:service name="StockService">
-		<wsdl:port name="StockPort" binding="tns:StockPortTypeBinding">
-			<soap:address location="http://localhost/changme"/>
+		<wsdl:port name="StockPort"
+			binding="tns:StockPortTypeBinding">
+			<soap:address location="http://localhost/changme" />
 		</wsdl:port>
 	</wsdl:service>
 </wsdl:definitions>



Mime
View raw message