[jbossws-commits] JBossWS SVN: r3276 - in trunk: integration/sunri/src/main/java/org/jboss/wsf/stack/sunri and 3 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue May 29 06:20:21 EDT 2007


Author: heiko.braun at jboss.com
Date: 2007-05-29 06:20:21 -0400 (Tue, 29 May 2007)
New Revision: 3276

Added:
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java
Modified:
   trunk/integration/sunri/ant-import/build-thirdparty.xml
   trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
   trunk/jbossws-core/ant-import/build-thirdparty.xml
Log:
Added SunRIConsumer impl

Modified: trunk/integration/sunri/ant-import/build-thirdparty.xml
===================================================================
--- trunk/integration/sunri/ant-import/build-thirdparty.xml	2007-05-29 09:44:14 UTC (rev 3275)
+++ trunk/integration/sunri/ant-import/build-thirdparty.xml	2007-05-29 10:20:21 UTC (rev 3276)
@@ -58,6 +58,8 @@
     <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/saaj-api.jar" dest="${thirdparty.dir}/saaj-api.jar" usetimestamp="true" verbose="true"/>
     <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/saaj-impl.jar" dest="${thirdparty.dir}/saaj-impl.jar" usetimestamp="true" verbose="true"/>
     <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/sjsxp.jar" dest="${thirdparty.dir}/sjsxp.jar" usetimestamp="true" verbose="true"/>
+    <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-rt.jar" dest="${thirdparty.dir}/jaxws-rt.jar" usetimestamp="true" verbose="true"/>
+    <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-tools.jar" dest="${thirdparty.dir}/jaxws-tools.jar" usetimestamp="true" verbose="true"/>
     <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/stax-ex.jar" dest="${thirdparty.dir}/stax-ex.jar" usetimestamp="true" verbose="true"/>
     <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/streambuffer.jar" dest="${thirdparty.dir}/streambuffer.jar" usetimestamp="true" verbose="true"/>
     <get src="${jboss.repository}/sun-jaxws/${sun-jaxws}/lib/jaxws-ri-src.jar" dest="${thirdparty.dir}/jaxws-ri-src.jar" usetimestamp="true" verbose="true"/> 
@@ -78,7 +80,9 @@
       <pathelement location="${spi.dir}/thirdparty/jboss-javaee.jar"/>
       <pathelement location="${thirdparty.dir}/http.jar"/>
       <pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
-      <pathelement location="${thirdparty.dir}/jaxws-api.jar"/>
+      <pathelement location="${thirdparty.dir}/jaxb-xjc.jar"/>
+      <pathelement location="${thirdparty.dir}/jaxws-api.jar"/>     
+      <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
       <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
       <pathelement location="${thirdparty.dir}/jsr181-api.jar"/>
       <pathelement location="${thirdparty.dir}/servlet-api.jar"/>

Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java	                        (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java	2007-05-29 10:20:21 UTC (rev 3276)
@@ -0,0 +1,209 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri.tools;
+
+import java.io.PrintStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Locale;
+
+class NullPrintStream extends PrintStream
+{
+   NullPrintStream()
+   {
+      // Doesn't actually do anything
+      super(new ByteArrayOutputStream());
+   }
+
+   @Override
+   public PrintStream append(char c)
+   {
+      return this;
+   }
+
+   @Override
+   public PrintStream append(CharSequence csq, int start, int end)
+   {
+      return this;
+   }
+
+   @Override
+   public PrintStream append(CharSequence csq)
+   {
+      return this;
+   }
+
+   @Override
+   public boolean checkError()
+   {
+      return false;
+   }
+
+   @Override
+   public void close()
+   {
+   }
+
+   @Override
+   public void flush()
+   {
+   }
+
+   @Override
+   public PrintStream format(Locale l, String format, Object... args)
+   {
+      return this;
+   }
+
+   @Override
+   public PrintStream format(String format, Object... args)
+   {
+      return this;
+   }
+
+   @Override
+   public void print(boolean b)
+   {
+   }
+
+   @Override
+   public void print(char c)
+   {
+   }
+
+   @Override
+   public void print(char[] s)
+   {
+   }
+
+   @Override
+   public void print(double d)
+   {
+   }
+
+   @Override
+   public void print(float f)
+   {
+   }
+
+   @Override
+   public void print(int i)
+   {
+   }
+
+   @Override
+   public void print(long l)
+   {
+   }
+
+   @Override
+   public void print(Object obj)
+   {
+   }
+
+   @Override
+   public void print(String s)
+   {
+   }
+
+   @Override
+   public PrintStream printf(Locale l, String format, Object... args)
+   {
+      return this;
+   }
+
+   @Override
+   public PrintStream printf(String format, Object... args)
+   {
+      return this;
+   }
+
+   @Override
+   public void println()
+   {
+   }
+
+   @Override
+   public void println(boolean x)
+   {
+   }
+
+   @Override
+   public void println(char x)
+   {
+   }
+
+   @Override
+   public void println(char[] x)
+   {
+   }
+
+   @Override
+   public void println(double x)
+   {
+   }
+
+   @Override
+   public void println(float x)
+   {
+   }
+
+   @Override
+   public void println(int x)
+   {
+   }
+
+   @Override
+   public void println(long x)
+   {
+   }
+
+   @Override
+   public void println(Object x)
+   {
+   }
+
+   @Override
+   public void println(String x)
+   {
+   }
+
+   @Override
+   protected void setError()
+   {
+   }
+
+   @Override
+   public void write(byte[] buf, int off, int len)
+   {
+   }
+
+   @Override
+   public void write(int b)
+   {
+   }
+
+   @Override
+   public void write(byte[] b) throws IOException
+   {
+   }
+}


Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/NullPrintStream.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java	                        (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java	2007-05-29 10:20:21 UTC (rev 3276)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri.tools;
+
+import org.jboss.wsf.spi.tools.spi.WSContractConsumerFactory;
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+/**
+ * Creates a WSContractConsumer that delegates to the Sun RI.
+ *
+ * @author <a href="jason.greene at jboss.com">Jason T. Greene</a>
+ * @version $Revision:2311 $
+ */
+public class SunRIConsumerFactoryImpl implements WSContractConsumerFactory
+{
+   public WSContractConsumer createConsumer() {
+      return new SunRIConsumerImpl();
+   }
+}


Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java	                        (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java	2007-05-29 10:20:21 UTC (rev 3276)
@@ -0,0 +1,169 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.sunri.tools;
+
+import org.jboss.wsf.spi.tools.api.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.ArrayList;
+import java.net.URL;
+
+import com.sun.tools.ws.wscompile.WsimportTool;
+
+/**
+ * WSContractConsumer that delegates to the Sun CompileTool.
+ *
+ * @author <a href="jason.greene at jboss.com">Jason T. Greene</a>
+ * @author <a href="heiko.braun at jboss.com">Heiko Braun</a>
+ * @version $Revision$
+ */
+public class SunRIConsumerImpl extends WSContractConsumer
+{
+   private List<File> bindingFiles = null;
+   private File catalog = null;
+   private boolean generateSource = false;
+   private File outputDir = new File("output");
+   private File sourceDir = null;
+   private String targetPackage = null;
+   private PrintStream messageStream = null;
+   private String wsdlLocation = null;
+   private List<String> additionalCompilerClassPath = null;
+
+   @Override
+   public void setBindingFiles(List<File> bindingFiles) {
+      this.bindingFiles = bindingFiles;
+   }
+
+   @Override
+   public void setCatalog(File catalog) {
+      this.catalog = catalog;
+   }
+
+   @Override
+   public void setGenerateSource(boolean generateSource) {
+      this.generateSource = generateSource;
+   }
+
+   @Override
+   public void setMessageStream(PrintStream messageStream) {
+      // TODO Auto-generated method stub
+      this.messageStream = messageStream;
+   }
+
+   @Override
+   public void setOutputDirectory(File directory) {
+      // TODO Auto-generated method stub
+      outputDir = directory;
+   }
+
+   @Override
+   public void setSourceDirectory(File directory) {
+      sourceDir = directory;
+   }
+
+   @Override
+   public void setTargetPackage(String targetPackage) {
+      this.targetPackage = targetPackage;
+   }
+
+   @Override
+   public void setWsdlLocation(String wsdlLocation) {
+      this.wsdlLocation = wsdlLocation;
+   }
+
+   public void setAdditionalCompilerClassPath(List<String> additionalCompilerClassPath) {
+      this.additionalCompilerClassPath = additionalCompilerClassPath;
+   }
+
+   @Override
+   public void consume(URL wsdl) {
+      List<String> args = new ArrayList<String>();
+      if (bindingFiles != null) {
+         for (File file : bindingFiles) {
+            args.add("-b");
+            args.add(file.getAbsolutePath());
+
+         }
+      }
+
+      if (catalog != null) {
+         args.add("-catalog");
+         args.add(catalog.getAbsolutePath());
+      }
+
+      if (generateSource) {
+         args.add("-keep");
+         if (sourceDir != null) {
+            if (!sourceDir.exists() && !sourceDir.mkdirs())
+               throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+
+            args.add("-s");
+            args.add(sourceDir.getAbsolutePath());
+         }
+      }
+
+      if (targetPackage != null) {
+         args.add("-p");
+         args.add(targetPackage);
+      }
+
+      if (wsdlLocation != null) {
+         args.add("-wsdllocation");
+         args.add(wsdlLocation);
+      }
+
+      PrintStream stream = messageStream;
+      if (stream != null) {
+         args.add("-verbose");
+      } else {
+         stream = new NullPrintStream();
+      }
+
+      if (!outputDir.exists() && !outputDir.mkdirs())
+         throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+
+      // Always add the output directory and the wsdl location
+      args.add("-d");
+      args.add(outputDir.getAbsolutePath());
+      args.add(wsdl.toString());
+
+      try
+      {
+         // enforce woodstox
+         if(null == System.getProperty("javax.xml.stream.XMLInputFactory"))
+            System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
+
+         WsimportTool compileTool = new WsimportTool(stream);
+         boolean success = compileTool.run(args.toArray(new String[0]));
+
+         if(!success) throw new IllegalStateException("WsImport invocation failed");
+      }
+      catch (Throwable t)
+      {
+         messageStream.println("Failed to invoke WsImport");
+         t.printStackTrace(messageStream);
+      }
+
+   }
+}


Property changes on: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/tools/SunRIConsumerImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl	2007-05-29 09:44:14 UTC (rev 3275)
+++ trunk/integration/sunri/src/main/resources/jbossws-sunri.jar/META-INF/services/org.jboss.wsf.tools.ConsumerFactoryImpl	2007-05-29 10:20:21 UTC (rev 3276)
@@ -1 +1 @@
-TODO:SUNRIConsumerFactoryImpl
\ No newline at end of file
+org.jboss.wsf.stack.sunri.tools.SunRIConsumerFactoryImpl
\ No newline at end of file

Modified: trunk/jbossws-core/ant-import/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/ant-import/build-thirdparty.xml	2007-05-29 09:44:14 UTC (rev 3275)
+++ trunk/jbossws-core/ant-import/build-thirdparty.xml	2007-05-29 10:20:21 UTC (rev 3276)
@@ -110,37 +110,37 @@
   <target name="thirdparty-classpath" depends="thirdparty-get">
     
     <!-- The compile classpath for jbossws core -->
-    <path id="thirdparty.classpath">
-      <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
-      <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
-      <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-ejb3x.jar"/>
-      <pathelement location="${thirdparty.dir}/activation.jar"/>
-      <pathelement location="${thirdparty.dir}/dom4j.jar"/>
-      <pathelement location="${thirdparty.dir}/getopt.jar"/>
-      <pathelement location="${thirdparty.dir}/javassist.jar"/>
-      <pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
-      <pathelement location="${thirdparty.dir}/jaxb-impl.jar"/>
-      <pathelement location="${thirdparty.dir}/jaxb-xjc.jar"/>
-      <pathelement location="${thirdparty.dir}/jboss-common-core.jar"/>
-      <pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
-      <pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
-      <pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
-      <pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
-      <pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
-      <pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
-      <pathelement location="${thirdparty.dir}/jbosssx.jar"/>
-      <pathelement location="${thirdparty.dir}/mail.jar"/>
-      <pathelement location="${thirdparty.dir}/servlet-api.jar"/>
-      <pathelement location="${thirdparty.dir}/stax-api.jar"/>
-      <pathelement location="${thirdparty.dir}/wsdl4j.jar"/>
-      <pathelement location="${thirdparty.dir}/wstx.jar"/>
-      <pathelement location="${thirdparty.dir}/xmlsec.jar"/>
-      <pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
-      <pathelement location="${thirdparty.dir}/xalan.jar"/>
-      <pathelement location="${thirdparty.dir}/policy.jar"/>
-      <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
-      <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
-    </path>
+     <path id="thirdparty.classpath">
+        <pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
+        <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
+        <pathelement location="${thirdparty.dir}/ejb3.deployer/jboss-ejb3x.jar"/>
+        <pathelement location="${thirdparty.dir}/activation.jar"/>
+        <pathelement location="${thirdparty.dir}/dom4j.jar"/>
+        <pathelement location="${thirdparty.dir}/getopt.jar"/>
+        <pathelement location="${thirdparty.dir}/javassist.jar"/>
+        <pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
+        <pathelement location="${thirdparty.dir}/jaxb-impl.jar"/>
+        <pathelement location="${thirdparty.dir}/jaxb-xjc.jar"/>
+        <pathelement location="${thirdparty.dir}/jaxws-rt.jar"/>
+        <pathelement location="${thirdparty.dir}/jaxws-tools.jar"/>
+        <pathelement location="${thirdparty.dir}/jboss-common-core.jar"/>
+        <pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
+        <pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
+        <pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
+        <pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
+        <pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
+        <pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
+        <pathelement location="${thirdparty.dir}/jbosssx.jar"/>
+        <pathelement location="${thirdparty.dir}/mail.jar"/>
+        <pathelement location="${thirdparty.dir}/servlet-api.jar"/>
+        <pathelement location="${thirdparty.dir}/stax-api.jar"/>
+        <pathelement location="${thirdparty.dir}/wsdl4j.jar"/>
+        <pathelement location="${thirdparty.dir}/wstx.jar"/>
+        <pathelement location="${thirdparty.dir}/xmlsec.jar"/>
+        <pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
+        <pathelement location="${thirdparty.dir}/xalan.jar"/>
+        <pathelement location="${thirdparty.dir}/policy.jar"/>
+     </path>
 
   </target>
 




More information about the jbossws-commits mailing list