cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r630382 [2/11] - in /incubator/cxf/trunk/tools: anttask/src/main/java/org/apache/cxf/ant/extensions/ common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/common/model/ common/src/test/java/org/apache/c...
Date Sat, 23 Feb 2008 03:12:56 GMT
Modified: incubator/cxf/trunk/tools/javato/ws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/pom.xml?rev=630382&r1=630381&r2=630382&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/pom.xml (original)
+++ incubator/cxf/trunk/tools/javato/ws/pom.xml Fri Feb 22 19:12:48 2008
@@ -1,224 +1,224 @@
-<!--
-    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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.cxf</groupId>
-    <artifactId>cxf-tools-java2ws</artifactId>
-    <packaging>jar</packaging>
-    <version>2.1-incubator-SNAPSHOT</version>
-    <name>Apache CXF Command Line Tools JavaTo WS</name>
-    <url>http://cwiki.apache.org/CXF</url>
-
-    <parent>
-        <groupId>org.apache.cxf</groupId>
-        <artifactId>cxf-parent</artifactId>
-        <version>2.1-incubator-SNAPSHOT</version>
-        <relativePath>../../parent/pom.xml</relativePath>
-    </parent>
-
-    <dependencies>    
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-tools-common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-frontend-simple</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-tools-wsdlto-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-tools-wsdlto-databinding-jaxb</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-tools-wsdlto-frontend-jaxws</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        
-        <dependency>
-	     <groupId>org.apache.cxf</groupId>
-	     <artifactId>cxf-rt-core</artifactId>
-	     <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-	     <groupId>org.apache.cxf</groupId>
-	     <artifactId>cxf-rt-javascript</artifactId>
-	     <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-        </dependency>
-
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-
-        <dependency>
-            <groupId>org.easymock</groupId>
-            <artifactId>easymockclassextension</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-
-        <dependency>
-            <groupId>asm</groupId>
-            <artifactId>asm</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-
-        <dependency>
-            <groupId>wsdl4j</groupId>
-            <artifactId>wsdl4j</artifactId>
-        </dependency>
-
-
-        <dependency>
-            <groupId>javax.xml.soap</groupId>
-            <artifactId>saaj-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codehaus.woodstox</groupId>
-            <artifactId>wstx-asl</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-databinding-aegis</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-frontend-jaxws</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.cxf</groupId>
-                    <artifactId>cxf-rt-bindings-xml</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-xjc</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>javax.xml.ws</groupId>
-            <artifactId>jaxws-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-testutils</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.cxf</groupId>
-                <artifactId>cxf-codegen-plugin</artifactId>
-                <version>${project.version}</version>
-                <executions>
-                    <execution>
-                        <id>generate-test-sources</id>
-                        <phase>generate-test-sources</phase>
-                        <configuration>
-                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
-                            <testWsdlRoot>${basedir}/src/test/resources/java2wsdl_wsdl</testWsdlRoot>
-                        </configuration>
-                        <goals>
-                            <goal>wsdl2java</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>1.0</version>
-                <executions>
-                    <execution>
-                        <id>add-source</id>
-                        <phase>generate-test-sources</phase>
-                        <goals>
-                            <goal>add-test-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>${basedir}/src/test/generated</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-        </plugins>
-    </build>
-    <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/core</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/ws</developerConnection>
-        <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-tools-java2wsdl</url>
-    </scm>
-
-</project>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf</groupId>
+    <artifactId>cxf-tools-java2ws</artifactId>
+    <packaging>jar</packaging>
+    <version>2.1-incubator-SNAPSHOT</version>
+    <name>Apache CXF Command Line Tools JavaTo WS</name>
+    <url>http://cwiki.apache.org/CXF</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.1-incubator-SNAPSHOT</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>    
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-simple</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-wsdlto-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-wsdlto-databinding-jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-wsdlto-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        
+        <dependency>
+	     <groupId>org.apache.cxf</groupId>
+	     <artifactId>cxf-rt-core</artifactId>
+	     <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+	     <groupId>org.apache.cxf</groupId>
+	     <artifactId>cxf-rt-javascript</artifactId>
+	     <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymockclassextension</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>javax.xml.soap</groupId>
+            <artifactId>saaj-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.woodstox</groupId>
+            <artifactId>wstx-asl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-databinding-aegis</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.cxf</groupId>
+                    <artifactId>cxf-rt-bindings-xml</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-xjc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.xml.ws</groupId>
+            <artifactId>jaxws-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-codegen-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <id>generate-test-sources</id>
+                        <phase>generate-test-sources</phase>
+                        <configuration>
+                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
+                            <testWsdlRoot>${basedir}/src/test/resources/java2wsdl_wsdl</testWsdlRoot>
+                        </configuration>
+                        <goals>
+                            <goal>wsdl2java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.0</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-test-sources</phase>
+                        <goals>
+                            <goal>add-test-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${basedir}/src/test/generated</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/core</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/tools/javato/ws</developerConnection>
+        <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-tools-java2wsdl</url>
+    </scm>
+
+</project>

Propchange: incubator/cxf/trunk/tools/javato/ws/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/javato/ws/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools/javato/ws/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml?rev=630382&r1=630381&r2=630382&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml (original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml Fri Feb 22 19:12:48 2008
@@ -1,32 +1,32 @@
-<?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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-<bean id='JaxwsServiceBuilderBean' class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype" />
-<bean id='SimpleServiceBuilderBean' class='org.apache.cxf.simple.SimpleServiceBuilder' scope="prototype" />
-
-<bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
-<bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype" />
-
-
-</beans>
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+<bean id='JaxwsServiceBuilderBean' class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype" />
+<bean id='SimpleServiceBuilderBean' class='org.apache.cxf.simple.SimpleServiceBuilder' scope="prototype" />
+
+<bean id='JaxbDatabindingBean' class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
+<bean id='AegisDatabindingBean' class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype" />
+
+
+</beans>

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/META-INF/cxf/java2wsbeans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java?rev=630382&r1=630381&r2=630382&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java (original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java Fri Feb 22 19:12:48 2008
@@ -1,125 +1,125 @@
-/**
- * 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.java2js;
-
-import java.io.File;
-import java.util.HashSet;
-
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.Processor;
-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.toolspec.ToolRunner;
-import org.apache.cxf.tools.common.toolspec.ToolSpec;
-import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
-import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
-import org.apache.cxf.tools.java2js.processor.JavaToJSProcessor;
-
-public class JavaToJS extends AbstractCXFToolContainer {
-
-    public static final String TOOL_NAME = "java2js";
-    
-    public JavaToJS(ToolSpec toolspec) throws Exception {
-        super(TOOL_NAME, toolspec);
-    }
-    
-    public void execute(boolean exitOnFinish) {
-        Processor processor = new JavaToJSProcessor();
-        try {
-            super.execute(exitOnFinish);
-            if (!hasInfoOption()) {
-                ToolContext env = new ToolContext();
-                env.setParameters(getParametersMap(new HashSet<String>()));
-                if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
-                    env.put(ToolConstants.CFG_OUTPUTDIR, ".");
-                }
-
-                if (isVerboseOn()) {
-                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
-                }
-                env.put(ToolConstants.CFG_CMD_ARG, getArgument());
-
-                validate(env);
-                
-                processor.setEnvironment(env);
-                processor.process();
-            }
-        } catch (ToolException ex) {
-            if (ex.getCause() instanceof BadUsageException) {
-                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
-            }
-            System.err.println();
-            System.err.println("JavaToJS Error : " + ex.getMessage());
-            if (isVerboseOn()) {
-                ex.printStackTrace();
-            }
-        } catch (Exception ex) {
-            System.err.println();
-            System.err.println("JavaToJS Error : " + ex.getMessage());
-            if (isVerboseOn()) {
-                ex.printStackTrace();
-            }
-        } finally {
-            tearDown();
-        }
-    }
-
-    private void validate(ToolContext env) throws ToolException {
-        String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
-        if (outdir != null) {
-            File dir = new File(outdir);
-            if (!dir.exists()) {
-                Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, outdir);
-                throw new ToolException(msg);
-            }
-            if (!dir.isDirectory()) {
-                Message msg = new Message("NOT_A_DIRECTORY", LOG, outdir);
-                throw new ToolException(msg);
-            }
-        }
-    }
-
-    public static void main(String[] pargs) {
-        try {
-            ToolRunner.runTool(JavaToJS.class,
-                               JavaToJS.class.getResourceAsStream("java2js.xml"),
-                               false,
-                               pargs);
-        } catch (ToolException ex) {
-            System.err.println("Java2JS Error : " + ex.getMessage());
-            System.err.println();
-            ex.printStackTrace();
-        } catch (Exception ex) {
-            System.err.println("Java2JS Error : " + ex.getMessage());
-            System.err.println();
-            ex.printStackTrace();
-        }
-    }
-
-    public void checkParams(ErrorVisitor errors) throws ToolException {
-        super.checkParams(errors);
-        if (errors.getErrors().size() > 0) {
-            Message msg = new Message("PARAMETER_MISSING", LOG);
-            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
-        }
-    }
+/**
+ * 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.java2js;
+
+import java.io.File;
+import java.util.HashSet;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.AbstractCXFToolContainer;
+import org.apache.cxf.tools.common.Processor;
+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.toolspec.ToolRunner;
+import org.apache.cxf.tools.common.toolspec.ToolSpec;
+import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
+import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
+import org.apache.cxf.tools.java2js.processor.JavaToJSProcessor;
+
+public class JavaToJS extends AbstractCXFToolContainer {
+
+    public static final String TOOL_NAME = "java2js";
+    
+    public JavaToJS(ToolSpec toolspec) throws Exception {
+        super(TOOL_NAME, toolspec);
+    }
+    
+    public void execute(boolean exitOnFinish) {
+        Processor processor = new JavaToJSProcessor();
+        try {
+            super.execute(exitOnFinish);
+            if (!hasInfoOption()) {
+                ToolContext env = new ToolContext();
+                env.setParameters(getParametersMap(new HashSet<String>()));
+                if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
+                    env.put(ToolConstants.CFG_OUTPUTDIR, ".");
+                }
+
+                if (isVerboseOn()) {
+                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
+                }
+                env.put(ToolConstants.CFG_CMD_ARG, getArgument());
+
+                validate(env);
+                
+                processor.setEnvironment(env);
+                processor.process();
+            }
+        } catch (ToolException ex) {
+            if (ex.getCause() instanceof BadUsageException) {
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+            }
+            System.err.println();
+            System.err.println("JavaToJS Error : " + ex.getMessage());
+            if (isVerboseOn()) {
+                ex.printStackTrace();
+            }
+        } catch (Exception ex) {
+            System.err.println();
+            System.err.println("JavaToJS Error : " + ex.getMessage());
+            if (isVerboseOn()) {
+                ex.printStackTrace();
+            }
+        } finally {
+            tearDown();
+        }
+    }
+
+    private void validate(ToolContext env) throws ToolException {
+        String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
+        if (outdir != null) {
+            File dir = new File(outdir);
+            if (!dir.exists()) {
+                Message msg = new Message("DIRECTORY_NOT_EXIST", LOG, outdir);
+                throw new ToolException(msg);
+            }
+            if (!dir.isDirectory()) {
+                Message msg = new Message("NOT_A_DIRECTORY", LOG, outdir);
+                throw new ToolException(msg);
+            }
+        }
+    }
+
+    public static void main(String[] pargs) {
+        try {
+            ToolRunner.runTool(JavaToJS.class,
+                               JavaToJS.class.getResourceAsStream("java2js.xml"),
+                               false,
+                               pargs);
+        } catch (ToolException ex) {
+            System.err.println("Java2JS Error : " + ex.getMessage());
+            System.err.println();
+            ex.printStackTrace();
+        } catch (Exception ex) {
+            System.err.println("Java2JS Error : " + ex.getMessage());
+            System.err.println();
+            ex.printStackTrace();
+        }
+    }
+
+    public void checkParams(ErrorVisitor errors) throws ToolException {
+        super.checkParams(errors);
+        if (errors.getErrors().size() > 0) {
+            Message msg = new Message("PARAMETER_MISSING", LOG);
+            throw new ToolException(msg, new BadUsageException(getUsage(), errors));
+        }
+    }
 }

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/java2js.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/java2js.xml?rev=630382&r1=630381&r2=630382&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/java2js.xml (original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/java2js.xml Fri Feb 22 19:12:48 2008
@@ -1,143 +1,143 @@
-<?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.
--->
-
-<!-- The xhtml namespace is for usage documentation -->
-<toolspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	  xmlns:xhtml="http://www.w3.org/TR/xhtml1/strict"
-	  xsi:schemaLocation="http://cxf.apache.org/Xutil/ToolSpecification http://cxf.apache.org/schema/xutil/tool-specification.xsd"
-	  xmlns="http://cxf.apache.org/Xutil/ToolSpecification"
-	  xmlns:ts="http://cxf.apache.org/Xutil/ToolSpecification">
-
-    <annotation>
-	Examples :
-	java2ws -javascript org.apache.hello_world_soap_http.Greeter -o bloop.js
-    </annotation>
-    <usage>
-	<optionGroup id="options">
-	    
-	    <option id="databinding" maxOccurs="1">
-		<annotation>
-		    Specify the data binding (aegis or jaxb). Default is jaxb for jaxws 
-		    frontend, and aegis for simple frontend.
-		</annotation>
-		<switch>databinding</switch>
-		<associatedArgument placement="afterSpace">
-		    <annotation>jaxb or aegis</annotation>
-		</associatedArgument>
-	    </option>
-	    
-	    <option id="javascriptUtils" maxOccurs="1">
-		<annotation>
-		    Write the JavaScript common utilities at the beginning of the output.
-		</annotation>
-		<switch>jsutils</switch>
-	    </option>
-
-	    <option id="outputfile" maxOccurs="1">
-		<annotation>
-		    Specify the output wsdl file name
-		</annotation>
-		<switch>o</switch>
-		<associatedArgument placement="afterSpace">
-		    <annotation>output-file</annotation>
-		</associatedArgument>
-	    </option>
-	    
-	    <option id="outputdir" maxOccurs="1">
-		<annotation>
-		    The directory in which the output wsdl and other 
-		    resource files are placed
-		</annotation>
-		<switch>d</switch>
-		<associatedArgument placement="afterSpace">
-		    <annotation>resource-directory</annotation>
-		</associatedArgument>
-	    </option>
-
-	    <option id="beans" maxOccurs="unbounded">
-		<annotation>Specify the pathname of a file defining additional Spring beans to customize databinding
-		configuration.</annotation>
-		<switch>beans</switch>
-		<associatedArgument placement="afterSpace">
-		    <annotation>pathname of the bean definition file.</annotation>
-		</associatedArgument>
-	    </option>
-	    
-	    <option id="classpath" maxOccurs="1">
-		<annotation>
-		    Specify the SEI and types class search path of
-		    directories and zip/jar files
-		</annotation>
-		<switch>cp</switch>
-		<associatedArgument placement="afterSpace">
-		    <annotation>class-path</annotation>
-		</associatedArgument>
-	    </option>
-
-	    <option id="soap12" maxOccurs="1">
-		<annotation>
-		    Specify to generate SOAP 1.2 binding
-		</annotation>
-		<switch>soap12</switch>
-	    </option>
-
-	</optionGroup>
-
-	<optionGroup id="common_options">
-	    <option id="help" maxOccurs="1">
-		<annotation>
-		    Display detailed information for options.
-		</annotation>
-		<switch>h</switch>
-		<switch>?</switch>
-		<switch>help</switch>
-	    </option>
-
-	    <option id="version">
-		<annotation>
-		    Display the version of the tool.
-		</annotation>
-		<switch>v</switch>
-	    </option>
-
-	    <option id="verbose">
-		<annotation>
-		    Verbose mode
-		</annotation>
-		<switch>verbose</switch>
-		<switch>V</switch>
-	    </option>
-
-	    <option id="quiet">
-		<annotation>
-		    Quiet mode
-		</annotation>
-		<switch>quiet</switch>
-		<switch>q</switch>
-	    </option>
-	</optionGroup>
-
-	<argument id="classname" minOccurs="1" maxOccurs="1">
-	    <annotation>
-		SEI class name
-	    </annotation>
-	</argument>
-    </usage>
-</toolspec>
+<?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.
+-->
+
+<!-- The xhtml namespace is for usage documentation -->
+<toolspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	  xmlns:xhtml="http://www.w3.org/TR/xhtml1/strict"
+	  xsi:schemaLocation="http://cxf.apache.org/Xutil/ToolSpecification http://cxf.apache.org/schema/xutil/tool-specification.xsd"
+	  xmlns="http://cxf.apache.org/Xutil/ToolSpecification"
+	  xmlns:ts="http://cxf.apache.org/Xutil/ToolSpecification">
+
+    <annotation>
+	Examples :
+	java2ws -javascript org.apache.hello_world_soap_http.Greeter -o bloop.js
+    </annotation>
+    <usage>
+	<optionGroup id="options">
+	    
+	    <option id="databinding" maxOccurs="1">
+		<annotation>
+		    Specify the data binding (aegis or jaxb). Default is jaxb for jaxws 
+		    frontend, and aegis for simple frontend.
+		</annotation>
+		<switch>databinding</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>jaxb or aegis</annotation>
+		</associatedArgument>
+	    </option>
+	    
+	    <option id="javascriptUtils" maxOccurs="1">
+		<annotation>
+		    Write the JavaScript common utilities at the beginning of the output.
+		</annotation>
+		<switch>jsutils</switch>
+	    </option>
+
+	    <option id="outputfile" maxOccurs="1">
+		<annotation>
+		    Specify the output wsdl file name
+		</annotation>
+		<switch>o</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>output-file</annotation>
+		</associatedArgument>
+	    </option>
+	    
+	    <option id="outputdir" maxOccurs="1">
+		<annotation>
+		    The directory in which the output wsdl and other 
+		    resource files are placed
+		</annotation>
+		<switch>d</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>resource-directory</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="beans" maxOccurs="unbounded">
+		<annotation>Specify the pathname of a file defining additional Spring beans to customize databinding
+		configuration.</annotation>
+		<switch>beans</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>pathname of the bean definition file.</annotation>
+		</associatedArgument>
+	    </option>
+	    
+	    <option id="classpath" maxOccurs="1">
+		<annotation>
+		    Specify the SEI and types class search path of
+		    directories and zip/jar files
+		</annotation>
+		<switch>cp</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>class-path</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="soap12" maxOccurs="1">
+		<annotation>
+		    Specify to generate SOAP 1.2 binding
+		</annotation>
+		<switch>soap12</switch>
+	    </option>
+
+	</optionGroup>
+
+	<optionGroup id="common_options">
+	    <option id="help" maxOccurs="1">
+		<annotation>
+		    Display detailed information for options.
+		</annotation>
+		<switch>h</switch>
+		<switch>?</switch>
+		<switch>help</switch>
+	    </option>
+
+	    <option id="version">
+		<annotation>
+		    Display the version of the tool.
+		</annotation>
+		<switch>v</switch>
+	    </option>
+
+	    <option id="verbose">
+		<annotation>
+		    Verbose mode
+		</annotation>
+		<switch>verbose</switch>
+		<switch>V</switch>
+	    </option>
+
+	    <option id="quiet">
+		<annotation>
+		    Quiet mode
+		</annotation>
+		<switch>quiet</switch>
+		<switch>q</switch>
+	    </option>
+	</optionGroup>
+
+	<argument id="classname" minOccurs="1" maxOccurs="1">
+	    <annotation>
+		SEI class name
+	    </annotation>
+	</argument>
+    </usage>
+</toolspec>

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/java2js.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/java2js.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/java2js.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java?rev=630382&r1=630381&r2=630382&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java (original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java Fri Feb 22 19:12:48 2008
@@ -1,310 +1,310 @@
-/**
- * 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.java2js.processor;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.ws.BindingType;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.BusApplicationContext;
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.javascript.BasicNameManager;
-import org.apache.cxf.javascript.JavascriptQueryHandler;
-import org.apache.cxf.javascript.NamespacePrefixAccumulator;
-import org.apache.cxf.javascript.service.ServiceJavascriptBuilder;
-import org.apache.cxf.javascript.types.SchemaJavascriptBuilder;
-import org.apache.cxf.service.ServiceBuilder;
-import org.apache.cxf.service.model.SchemaInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.tools.common.Processor;
-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.java2wsdl.processor.internal.ServiceBuilderFactory;
-import org.apache.cxf.tools.util.AnnotationUtil;
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.springframework.beans.factory.BeanDefinitionStoreException;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.FileSystemResource;
-
-public class JavaToJSProcessor implements Processor {
-    private static final Logger LOG = LogUtils.getL7dLogger(JavaToJSProcessor.class);
-    private static final String JAVA_CLASS_PATH = "java.class.path";
-    private static final Charset UTF8 = Charset.forName("utf-8");
-    private ToolContext context;
-    private ApplicationContext applicationContext;
-
-    /**
-     * This is factored out to permit use in a unit test.
-     * 
-     * @param bus
-     * @return
-     */
-    public static ApplicationContext getApplicationContext(Bus bus, List<String> additionalFilePathnames) {
-        BusApplicationContext busApplicationContext = bus.getExtension(BusApplicationContext.class);
-        GenericApplicationContext appContext = new GenericApplicationContext(busApplicationContext);
-        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);
-        reader.loadBeanDefinitions(new ClassPathResource("META-INF/cxf/java2wsbeans.xml"));
-        for (String pathname : additionalFilePathnames) {
-            try {
-                reader.loadBeanDefinitions(new FileSystemResource(pathname));
-            } catch (BeanDefinitionStoreException bdse) {
-                throw new ToolException("Unable to open bean definition file " + pathname, bdse.getCause());
-            }
-        }
-
-        return appContext;
-    }
-
-    public void process() throws ToolException {
-        String oldClassPath = System.getProperty(JAVA_CLASS_PATH);
-        LOG.log(Level.INFO, "OLD_CP", oldClassPath);
-        if (context.get(ToolConstants.CFG_CLASSPATH) != null) {
-            String newCp = (String)context.get(ToolConstants.CFG_CLASSPATH);
-            System.setProperty(JAVA_CLASS_PATH, newCp + File.pathSeparator + oldClassPath);
-            LOG.log(Level.INFO, "NEW_CP", newCp);
-        }
-
-        // check for command line specification of data binding.
-
-        ServiceBuilder builder = getServiceBuilder();
-        ServiceInfo serviceInfo = builder.createService();
-
-        File jsFile = getOutputFile(builder.getOutputFile(), serviceInfo.getName().getLocalPart() + ".js");
-
-        BasicNameManager nameManager = BasicNameManager.newNameManager(serviceInfo, null);
-        NamespacePrefixAccumulator prefixManager = new NamespacePrefixAccumulator(serviceInfo
-            .getXmlSchemaCollection());
-        Collection<SchemaInfo> schemata = serviceInfo.getSchemas();
-        try {
-            FileOutputStream fileOutputStream = new FileOutputStream(jsFile);
-            if (null != context.get(ToolConstants.CFG_JAVASCRIPT_UTILS)) {
-                JavascriptQueryHandler.writeUtilsToResponseStream(JavaToJSProcessor.class, fileOutputStream);
-            }
-            
-            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, UTF8);
-            BufferedWriter writer = new BufferedWriter(outputStreamWriter);
-                
-            for (SchemaInfo schema : schemata) {
-                SchemaJavascriptBuilder jsBuilder = new SchemaJavascriptBuilder(serviceInfo
-                    .getXmlSchemaCollection(), prefixManager, nameManager);
-                String allThatJavascript = jsBuilder.generateCodeForSchema(schema);
-                writer.append(allThatJavascript);
-            }
-
-            ServiceJavascriptBuilder serviceBuilder = new ServiceJavascriptBuilder(serviceInfo, prefixManager,
-                                                                                   nameManager);
-            serviceBuilder.walk();
-            String serviceJavascript = serviceBuilder.getCode();
-            writer.append(serviceJavascript);
-            writer.close();
-        } catch (FileNotFoundException e) {
-            throw new ToolException(e);
-        } catch (IOException e) {
-            throw new ToolException(e);
-        }
-
-        System.setProperty(JAVA_CLASS_PATH, oldClassPath);
-        LOG.log(Level.INFO, "RESUME_CP", oldClassPath);
-    }
-
-    @SuppressWarnings("unchecked")
-    public ServiceBuilder getServiceBuilder() throws ToolException {
-        Object beanFilesParameter = context.get(ToolConstants.CFG_BEAN_CONFIG);
-        List<String> beanDefinitions = new ArrayList<String>();
-        if (beanFilesParameter != null) {
-            if (beanFilesParameter instanceof String) {
-                beanDefinitions.add((String)beanFilesParameter);
-            } else if (beanFilesParameter instanceof List) {
-                // is there a better way to avoid the warning?
-                beanDefinitions.addAll((List<String>)beanFilesParameter);
-            }
-        }
-        applicationContext = getApplicationContext(getBus(), beanDefinitions);
-        ServiceBuilderFactory builderFactory = ServiceBuilderFactory.getInstance();
-        Class<?> clz = getServiceClass();
-        context.put(Class.class, clz);
-        if (clz.isInterface()) {
-            context.put(ToolConstants.GEN_FROM_SEI, Boolean.TRUE);
-            context.put(ToolConstants.SEI_CLASS, clz.getName());
-        } else {
-            context.put(ToolConstants.IMPL_CLASS, clz.getName());
-            if (clz.getInterfaces().length == 1) {
-                context.put(ToolConstants.SEI_CLASS, clz.getInterfaces()[0].getName());
-            }
-            // TODO: if it is simple frontend, and the impl class implements
-            // multiple interfaces
-            context.put(ToolConstants.GEN_FROM_SEI, Boolean.FALSE);
-        }
-        builderFactory.setServiceClass(clz);
-        builderFactory.setDatabindingName(getDataBindingName());
-        // The service class determines the frontend, so no need to pass it in
-        // twice.
-        ServiceBuilder builder = builderFactory.newBuilder(applicationContext);
-
-        builder.validate();
-
-        builder.setTransportId(getTransportId());
-        builder.setBus(getBus());
-        builder.setBindingId(getBindingId());
-
-        return builder;
-    }
-
-    protected String getTransportId() {
-        if (isSOAP12()) {
-            return WSDLConstants.NS_SOAP12;
-        }
-        return WSDLConstants.NS_SOAP11;
-    }
-
-    protected String getBindingId() {
-        if (isSOAP12()) {
-            return WSDLConstants.NS_SOAP12;
-        } else {
-            return WSDLConstants.NS_SOAP11;
-        }
-    }
-
-    protected boolean isSOAP12() {
-        if (!this.context.optionSet(ToolConstants.CFG_SOAP12)) {
-            BindingType bType = getServiceClass().getAnnotation(BindingType.class);
-            if (bType != null) {
-                return SOAPBinding.SOAP12HTTP_BINDING.equals(bType.value());
-            }
-            return false;
-        }
-        return true;
-    }
-
-    protected File getOutputDir(File wsdlLocation) {
-        String dir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
-        if (dir == null) {
-            if (wsdlLocation == null 
-                || wsdlLocation.getParentFile() == null
-                || !wsdlLocation.getParentFile().exists()) {
-                dir = "./";
-            } else {
-                dir = wsdlLocation.getParent();
-            } 
-        }
-        return new File(dir);
-    }
-
-    protected File getOutputFile(File nameFromClz, String defaultOutputFile) {
-        String output = (String)context.get(ToolConstants.CFG_OUTPUTFILE);
-        String dir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
-        if (dir == null) {
-            dir = "./";
-        }
-
-        File result;
-        if (output != null) {
-            result = new File(output);
-            if (!result.isAbsolute()) {
-                result = new File(new File(dir), output);
-            }
-        } else {
-            result = new File(new File(dir), defaultOutputFile);
-        }
-        if (nameFromClz != null) {
-            result = nameFromClz;
-        }
-
-        // rename the exising wsdl file
-        if (result.exists() && !result.renameTo(new File(result.getParent(), result.getName()))) {
-            throw new ToolException(new Message("OUTFILE_EXISTS", LOG));
-        }
-        return result;
-    }
-
-    public Class<?> getServiceClass() {
-        return AnnotationUtil.loadClass((String)context.get(ToolConstants.CFG_CLASSNAME), Thread
-            .currentThread().getContextClassLoader());
-    }
-
-    public WSDLConstants.WSDLVersion getWSDLVersion() {
-        String version = (String)context.get(ToolConstants.CFG_WSDL_VERSION);
-        WSDLConstants.WSDLVersion wsVersion = WSDLConstants.getVersion(version);
-        if (wsVersion == WSDLConstants.WSDLVersion.UNKNOWN) {
-            wsVersion = WSDLConstants.WSDLVersion.WSDL11;
-        }
-        return wsVersion;
-    }
-
-    public String getServiceName() {
-        return (String)this.context.get(ToolConstants.CFG_SERVICENAME);
-    }
-
-    File getSourceDir() {
-        String dir = (String)this.context.get(ToolConstants.CFG_SOURCEDIR);
-        if (StringUtils.isEmpty(dir)) {
-            return null;
-        }
-        return new File(dir);
-    }
-
-    File getClassesDir() {
-        String dir = (String)this.context.get(ToolConstants.CFG_CLASSDIR);
-        if (StringUtils.isEmpty(dir)) {
-            return null;
-        }
-        return new File(dir);
-    }
-
-    public Bus getBus() {
-        return BusFactory.getDefaultBus();
-    }
-
-    public void setEnvironment(ToolContext env) {
-        this.context = env;
-    }
-
-    public ToolContext getEnvironment() {
-        return this.context;
-    }
-
-    public String getDataBindingName() {
-        String databindingName = (String)context.get(ToolConstants.CFG_DATABINDING);
-        if (databindingName == null) {
-            databindingName = ToolConstants.DEFAULT_DATA_BINDING_NAME;
-        }
-        return databindingName;
-    }
-}
+/**
+ * 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.java2js.processor;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.BusApplicationContext;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.javascript.BasicNameManager;
+import org.apache.cxf.javascript.JavascriptQueryHandler;
+import org.apache.cxf.javascript.NamespacePrefixAccumulator;
+import org.apache.cxf.javascript.service.ServiceJavascriptBuilder;
+import org.apache.cxf.javascript.types.SchemaJavascriptBuilder;
+import org.apache.cxf.service.ServiceBuilder;
+import org.apache.cxf.service.model.SchemaInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.Processor;
+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.java2wsdl.processor.internal.ServiceBuilderFactory;
+import org.apache.cxf.tools.util.AnnotationUtil;
+import org.apache.cxf.wsdl.WSDLConstants;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.FileSystemResource;
+
+public class JavaToJSProcessor implements Processor {
+    private static final Logger LOG = LogUtils.getL7dLogger(JavaToJSProcessor.class);
+    private static final String JAVA_CLASS_PATH = "java.class.path";
+    private static final Charset UTF8 = Charset.forName("utf-8");
+    private ToolContext context;
+    private ApplicationContext applicationContext;
+
+    /**
+     * This is factored out to permit use in a unit test.
+     * 
+     * @param bus
+     * @return
+     */
+    public static ApplicationContext getApplicationContext(Bus bus, List<String> additionalFilePathnames) {
+        BusApplicationContext busApplicationContext = bus.getExtension(BusApplicationContext.class);
+        GenericApplicationContext appContext = new GenericApplicationContext(busApplicationContext);
+        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);
+        reader.loadBeanDefinitions(new ClassPathResource("META-INF/cxf/java2wsbeans.xml"));
+        for (String pathname : additionalFilePathnames) {
+            try {
+                reader.loadBeanDefinitions(new FileSystemResource(pathname));
+            } catch (BeanDefinitionStoreException bdse) {
+                throw new ToolException("Unable to open bean definition file " + pathname, bdse.getCause());
+            }
+        }
+
+        return appContext;
+    }
+
+    public void process() throws ToolException {
+        String oldClassPath = System.getProperty(JAVA_CLASS_PATH);
+        LOG.log(Level.INFO, "OLD_CP", oldClassPath);
+        if (context.get(ToolConstants.CFG_CLASSPATH) != null) {
+            String newCp = (String)context.get(ToolConstants.CFG_CLASSPATH);
+            System.setProperty(JAVA_CLASS_PATH, newCp + File.pathSeparator + oldClassPath);
+            LOG.log(Level.INFO, "NEW_CP", newCp);
+        }
+
+        // check for command line specification of data binding.
+
+        ServiceBuilder builder = getServiceBuilder();
+        ServiceInfo serviceInfo = builder.createService();
+
+        File jsFile = getOutputFile(builder.getOutputFile(), serviceInfo.getName().getLocalPart() + ".js");
+
+        BasicNameManager nameManager = BasicNameManager.newNameManager(serviceInfo, null);
+        NamespacePrefixAccumulator prefixManager = new NamespacePrefixAccumulator(serviceInfo
+            .getXmlSchemaCollection());
+        Collection<SchemaInfo> schemata = serviceInfo.getSchemas();
+        try {
+            FileOutputStream fileOutputStream = new FileOutputStream(jsFile);
+            if (null != context.get(ToolConstants.CFG_JAVASCRIPT_UTILS)) {
+                JavascriptQueryHandler.writeUtilsToResponseStream(JavaToJSProcessor.class, fileOutputStream);
+            }
+            
+            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, UTF8);
+            BufferedWriter writer = new BufferedWriter(outputStreamWriter);
+                
+            for (SchemaInfo schema : schemata) {
+                SchemaJavascriptBuilder jsBuilder = new SchemaJavascriptBuilder(serviceInfo
+                    .getXmlSchemaCollection(), prefixManager, nameManager);
+                String allThatJavascript = jsBuilder.generateCodeForSchema(schema);
+                writer.append(allThatJavascript);
+            }
+
+            ServiceJavascriptBuilder serviceBuilder = new ServiceJavascriptBuilder(serviceInfo, prefixManager,
+                                                                                   nameManager);
+            serviceBuilder.walk();
+            String serviceJavascript = serviceBuilder.getCode();
+            writer.append(serviceJavascript);
+            writer.close();
+        } catch (FileNotFoundException e) {
+            throw new ToolException(e);
+        } catch (IOException e) {
+            throw new ToolException(e);
+        }
+
+        System.setProperty(JAVA_CLASS_PATH, oldClassPath);
+        LOG.log(Level.INFO, "RESUME_CP", oldClassPath);
+    }
+
+    @SuppressWarnings("unchecked")
+    public ServiceBuilder getServiceBuilder() throws ToolException {
+        Object beanFilesParameter = context.get(ToolConstants.CFG_BEAN_CONFIG);
+        List<String> beanDefinitions = new ArrayList<String>();
+        if (beanFilesParameter != null) {
+            if (beanFilesParameter instanceof String) {
+                beanDefinitions.add((String)beanFilesParameter);
+            } else if (beanFilesParameter instanceof List) {
+                // is there a better way to avoid the warning?
+                beanDefinitions.addAll((List<String>)beanFilesParameter);
+            }
+        }
+        applicationContext = getApplicationContext(getBus(), beanDefinitions);
+        ServiceBuilderFactory builderFactory = ServiceBuilderFactory.getInstance();
+        Class<?> clz = getServiceClass();
+        context.put(Class.class, clz);
+        if (clz.isInterface()) {
+            context.put(ToolConstants.GEN_FROM_SEI, Boolean.TRUE);
+            context.put(ToolConstants.SEI_CLASS, clz.getName());
+        } else {
+            context.put(ToolConstants.IMPL_CLASS, clz.getName());
+            if (clz.getInterfaces().length == 1) {
+                context.put(ToolConstants.SEI_CLASS, clz.getInterfaces()[0].getName());
+            }
+            // TODO: if it is simple frontend, and the impl class implements
+            // multiple interfaces
+            context.put(ToolConstants.GEN_FROM_SEI, Boolean.FALSE);
+        }
+        builderFactory.setServiceClass(clz);
+        builderFactory.setDatabindingName(getDataBindingName());
+        // The service class determines the frontend, so no need to pass it in
+        // twice.
+        ServiceBuilder builder = builderFactory.newBuilder(applicationContext);
+
+        builder.validate();
+
+        builder.setTransportId(getTransportId());
+        builder.setBus(getBus());
+        builder.setBindingId(getBindingId());
+
+        return builder;
+    }
+
+    protected String getTransportId() {
+        if (isSOAP12()) {
+            return WSDLConstants.NS_SOAP12;
+        }
+        return WSDLConstants.NS_SOAP11;
+    }
+
+    protected String getBindingId() {
+        if (isSOAP12()) {
+            return WSDLConstants.NS_SOAP12;
+        } else {
+            return WSDLConstants.NS_SOAP11;
+        }
+    }
+
+    protected boolean isSOAP12() {
+        if (!this.context.optionSet(ToolConstants.CFG_SOAP12)) {
+            BindingType bType = getServiceClass().getAnnotation(BindingType.class);
+            if (bType != null) {
+                return SOAPBinding.SOAP12HTTP_BINDING.equals(bType.value());
+            }
+            return false;
+        }
+        return true;
+    }
+
+    protected File getOutputDir(File wsdlLocation) {
+        String dir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
+        if (dir == null) {
+            if (wsdlLocation == null 
+                || wsdlLocation.getParentFile() == null
+                || !wsdlLocation.getParentFile().exists()) {
+                dir = "./";
+            } else {
+                dir = wsdlLocation.getParent();
+            } 
+        }
+        return new File(dir);
+    }
+
+    protected File getOutputFile(File nameFromClz, String defaultOutputFile) {
+        String output = (String)context.get(ToolConstants.CFG_OUTPUTFILE);
+        String dir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
+        if (dir == null) {
+            dir = "./";
+        }
+
+        File result;
+        if (output != null) {
+            result = new File(output);
+            if (!result.isAbsolute()) {
+                result = new File(new File(dir), output);
+            }
+        } else {
+            result = new File(new File(dir), defaultOutputFile);
+        }
+        if (nameFromClz != null) {
+            result = nameFromClz;
+        }
+
+        // rename the exising wsdl file
+        if (result.exists() && !result.renameTo(new File(result.getParent(), result.getName()))) {
+            throw new ToolException(new Message("OUTFILE_EXISTS", LOG));
+        }
+        return result;
+    }
+
+    public Class<?> getServiceClass() {
+        return AnnotationUtil.loadClass((String)context.get(ToolConstants.CFG_CLASSNAME), Thread
+            .currentThread().getContextClassLoader());
+    }
+
+    public WSDLConstants.WSDLVersion getWSDLVersion() {
+        String version = (String)context.get(ToolConstants.CFG_WSDL_VERSION);
+        WSDLConstants.WSDLVersion wsVersion = WSDLConstants.getVersion(version);
+        if (wsVersion == WSDLConstants.WSDLVersion.UNKNOWN) {
+            wsVersion = WSDLConstants.WSDLVersion.WSDL11;
+        }
+        return wsVersion;
+    }
+
+    public String getServiceName() {
+        return (String)this.context.get(ToolConstants.CFG_SERVICENAME);
+    }
+
+    File getSourceDir() {
+        String dir = (String)this.context.get(ToolConstants.CFG_SOURCEDIR);
+        if (StringUtils.isEmpty(dir)) {
+            return null;
+        }
+        return new File(dir);
+    }
+
+    File getClassesDir() {
+        String dir = (String)this.context.get(ToolConstants.CFG_CLASSDIR);
+        if (StringUtils.isEmpty(dir)) {
+            return null;
+        }
+        return new File(dir);
+    }
+
+    public Bus getBus() {
+        return BusFactory.getDefaultBus();
+    }
+
+    public void setEnvironment(ToolContext env) {
+        this.context = env;
+    }
+
+    public ToolContext getEnvironment() {
+        return this.context;
+    }
+
+    public String getDataBindingName() {
+        String databindingName = (String)context.get(ToolConstants.CFG_DATABINDING);
+        if (databindingName == null) {
+            databindingName = ToolConstants.DEFAULT_DATA_BINDING_NAME;
+        }
+        return databindingName;
+    }
+}

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java?rev=630382&r1=630381&r2=630382&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java (original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java Fri Feb 22 19:12:48 2008
@@ -1,88 +1,88 @@
-/**
- * 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.java2ws;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.tools.common.toolspec.ToolRunner;
-
-public class JavaToWS {
-
-    private String[] args;
-
-    public JavaToWS() {
-        args = new String[0];
-    }
-
-    public JavaToWS(String pargs[]) {
-        args = pargs;
-    }
-
-    public static void main(String[] args) {
-        JavaToWS j2w = new JavaToWS(args);
-        try {
-            j2w.run();
-        } catch (Exception ex) {
-            System.err.println("JavaToWS Error: " + ex.getMessage());
-            System.err.println();
-            if (j2w.isVerbose()) {
-                ex.printStackTrace();
-            }
-            if (j2w.isExitOnFinish()) {
-                System.exit(1);
-            }
-        }
-    }
-
-    public boolean isVerbose() {
-        return isSet(new String[] {"-V", "-verbose"});
-    }
-
-    private boolean isSet(String[] keys) {
-        if (args == null) {
-            return false;
-        }
-        List<String> pargs = Arrays.asList(args);
-
-        for (String key : keys) {
-            if (pargs.contains(key)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private void run() throws Exception {
-        ToolRunner.runTool(JavaToWSContainer.class, JavaToWSContainer.class
-                           .getResourceAsStream("java2ws.xml"), false, args);      
-    }
-
-    private boolean isExitOnFinish() {
-        String exit = System.getProperty("exitOnFinish");
-        if (StringUtils.isEmpty(exit)) {
-            return false;
-        }
-        return "YES".equalsIgnoreCase(exit) || "TRUE".equalsIgnoreCase(exit);
-    }
-    
-    
-
-}
+/**
+ * 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.java2ws;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.tools.common.toolspec.ToolRunner;
+
+public class JavaToWS {
+
+    private String[] args;
+
+    public JavaToWS() {
+        args = new String[0];
+    }
+
+    public JavaToWS(String pargs[]) {
+        args = pargs;
+    }
+
+    public static void main(String[] args) {
+        JavaToWS j2w = new JavaToWS(args);
+        try {
+            j2w.run();
+        } catch (Exception ex) {
+            System.err.println("JavaToWS Error: " + ex.getMessage());
+            System.err.println();
+            if (j2w.isVerbose()) {
+                ex.printStackTrace();
+            }
+            if (j2w.isExitOnFinish()) {
+                System.exit(1);
+            }
+        }
+    }
+
+    public boolean isVerbose() {
+        return isSet(new String[] {"-V", "-verbose"});
+    }
+
+    private boolean isSet(String[] keys) {
+        if (args == null) {
+            return false;
+        }
+        List<String> pargs = Arrays.asList(args);
+
+        for (String key : keys) {
+            if (pargs.contains(key)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private void run() throws Exception {
+        ToolRunner.runTool(JavaToWSContainer.class, JavaToWSContainer.class
+                           .getResourceAsStream("java2ws.xml"), false, args);      
+    }
+
+    private boolean isExitOnFinish() {
+        String exit = System.getProperty("exitOnFinish");
+        if (StringUtils.isEmpty(exit)) {
+            return false;
+        }
+        return "YES".equalsIgnoreCase(exit) || "TRUE".equalsIgnoreCase(exit);
+    }
+    
+    
+
+}

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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=630382&r1=630381&r2=630382&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 Feb 22 19:12:48 2008
@@ -1,154 +1,154 @@
-/**
- * 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.java2ws;
-
-import java.util.HashSet;
-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.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.Processor;
-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.toolspec.ToolSpec;
-import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
-import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
-import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
-import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
-import org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.JAXWSFrontEndProcessor;
-import org.apache.cxf.tools.java2wsdl.processor.internal.simple.SimpleFrontEndProcessor;
-
-public class JavaToWSContainer extends AbstractCXFToolContainer {
-    private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSContainer.class);
-    private static final String TOOL_NAME = "java2ws";
-
-    public JavaToWSContainer(ToolSpec toolspec) throws Exception {
-        super(TOOL_NAME, toolspec);
-    }
-
-    public void execute(boolean exitOnFinish) throws ToolException {
-        //ErrorVisitor errors = new ErrorVisitor();
-        try {
-            super.execute(exitOnFinish);
-            //checkParams(errors);
-            if (!hasInfoOption()) {
-                ToolContext env = new ToolContext();
-                env.setParameters(getParametersMap(new HashSet()));
-                if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
-                    env.put(ToolConstants.CFG_OUTPUTDIR, ".");
-                }
-                
-                if (env.get(ToolConstants.CFG_SOURCEDIR) == null) {
-                    env.put(ToolConstants.CFG_SOURCEDIR, ".");
-                }
-                
-                if (isVerboseOn()) {
-                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
-                }
-                String ft = (String)env.get(ToolConstants.CFG_FRONTEND);
-                if (ft == null || ToolConstants.JAXWS_FRONTEND.equals(ft)) {
-                    ft = ToolConstants.JAXWS_FRONTEND;
-                } else {
-                    ft = ToolConstants.SIMPLE_FRONTEND;
-                    //use aegis databinding for simple front end by default
-                    env.put(ToolConstants.CFG_DATABINDING, ToolConstants.AEGIS_DATABINDING);
-                }
-                env.put(ToolConstants.CFG_FRONTEND, ft);
-                processWSDL(env, ft);
-            }
-        } catch (ToolException ex) {
-            if (ex.getCause() instanceof BadUsageException) {
-                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
-                if (isVerboseOn()) {
-                    ex.printStackTrace();
-                }
-            }
-            throw ex;
-        } catch (Exception ex) {
-            System.err.println("Error: " + ex.getMessage());
-            System.err.println();
-            if (isVerboseOn()) {
-                ex.printStackTrace();
-            }
-
-            throw new ToolException(ex.getMessage(), ex.getCause());
-        } finally {
-            tearDown();
-        }
-    }
-
-    private void processWSDL(ToolContext env, String ft) {
-        Processor processor = new JavaToWSDLProcessor();
-        processor.setEnvironment(env);
-        processor.process();
-        
-        
-        if (ft.equals(ToolConstants.JAXWS_FRONTEND)) {
-            if (env.optionSet(ToolConstants.CFG_SERVER) || env.optionSet(ToolConstants.CFG_CLIENT)) {
-                processor = new JAXWSFrontEndProcessor();
-                processor.setEnvironment(env);
-                processor.process();
-            }
-        } else {               
-            processor = new SimpleFrontEndProcessor();
-            processor.setEnvironment(env);
-            processor.process();
-        }
-    }
-
-    public void checkParams(ErrorVisitor errs) throws ToolException {
-        super.checkParams(errs);
-        CommandDocument doc = super.getCommandDocument();
-
-        if (doc.hasParameter(ToolConstants.CFG_FRONTEND)) {
-            String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
-            if (!ToolConstants.JAXWS_FRONTEND.equals(ft) 
-                && !ToolConstants.SIMPLE_FRONTEND.equals(ft)) {
-                Message msg = new Message("INVALID_FRONTEND", LOG, new Object[] {ft});
-                errs.add(new ErrorVisitor.UserError(msg.toString()));
-            }
-            
-            if (ToolConstants.SIMPLE_FRONTEND.equals(ft) 
-                && doc.getParameter(ToolConstants.CFG_DATABINDING) != null 
-                && !ToolConstants.
-                AEGIS_DATABINDING.equals(doc.getParameter(ToolConstants.CFG_DATABINDING))) {
-                Message msg = new Message("INVALID_DATABINDING_FOR_SIMPLE", LOG);
-                errs.add(new ErrorVisitor.UserError(msg.toString()));
-            }
-            
-        }
-
-        if (doc.hasParameter(ToolConstants.CFG_WRAPPERBEAN)) {
-            String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
-            if (ft != null && !ToolConstants.JAXWS_FRONTEND.equals(ft)) {
-                Message msg = new Message("WRAPPERBEAN_WITHOUT_JAXWS", LOG);
-                errs.add(new ErrorVisitor.UserError(msg.toString()));
-            }
-        }
-        
-        
-        if (errs.getErrors().size() > 0) {
-            Message msg = new Message("PARAMETER_MISSING", LOG);
-            throw new ToolException(msg, new BadUsageException(getUsage(), errs));
-        }
-
-    }
-}
+/**
+ * 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.java2ws;
+
+import java.util.HashSet;
+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.AbstractCXFToolContainer;
+import org.apache.cxf.tools.common.Processor;
+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.toolspec.ToolSpec;
+import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
+import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
+import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
+import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
+import org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.JAXWSFrontEndProcessor;
+import org.apache.cxf.tools.java2wsdl.processor.internal.simple.SimpleFrontEndProcessor;
+
+public class JavaToWSContainer extends AbstractCXFToolContainer {
+    private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSContainer.class);
+    private static final String TOOL_NAME = "java2ws";
+
+    public JavaToWSContainer(ToolSpec toolspec) throws Exception {
+        super(TOOL_NAME, toolspec);
+    }
+
+    public void execute(boolean exitOnFinish) throws ToolException {
+        //ErrorVisitor errors = new ErrorVisitor();
+        try {
+            super.execute(exitOnFinish);
+            //checkParams(errors);
+            if (!hasInfoOption()) {
+                ToolContext env = new ToolContext();
+                env.setParameters(getParametersMap(new HashSet()));
+                if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
+                    env.put(ToolConstants.CFG_OUTPUTDIR, ".");
+                }
+                
+                if (env.get(ToolConstants.CFG_SOURCEDIR) == null) {
+                    env.put(ToolConstants.CFG_SOURCEDIR, ".");
+                }
+                
+                if (isVerboseOn()) {
+                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
+                }
+                String ft = (String)env.get(ToolConstants.CFG_FRONTEND);
+                if (ft == null || ToolConstants.JAXWS_FRONTEND.equals(ft)) {
+                    ft = ToolConstants.JAXWS_FRONTEND;
+                } else {
+                    ft = ToolConstants.SIMPLE_FRONTEND;
+                    //use aegis databinding for simple front end by default
+                    env.put(ToolConstants.CFG_DATABINDING, ToolConstants.AEGIS_DATABINDING);
+                }
+                env.put(ToolConstants.CFG_FRONTEND, ft);
+                processWSDL(env, ft);
+            }
+        } catch (ToolException ex) {
+            if (ex.getCause() instanceof BadUsageException) {
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                if (isVerboseOn()) {
+                    ex.printStackTrace();
+                }
+            }
+            throw ex;
+        } catch (Exception ex) {
+            System.err.println("Error: " + ex.getMessage());
+            System.err.println();
+            if (isVerboseOn()) {
+                ex.printStackTrace();
+            }
+
+            throw new ToolException(ex.getMessage(), ex.getCause());
+        } finally {
+            tearDown();
+        }
+    }
+
+    private void processWSDL(ToolContext env, String ft) {
+        Processor processor = new JavaToWSDLProcessor();
+        processor.setEnvironment(env);
+        processor.process();
+        
+        
+        if (ft.equals(ToolConstants.JAXWS_FRONTEND)) {
+            if (env.optionSet(ToolConstants.CFG_SERVER) || env.optionSet(ToolConstants.CFG_CLIENT)) {
+                processor = new JAXWSFrontEndProcessor();
+                processor.setEnvironment(env);
+                processor.process();
+            }
+        } else {               
+            processor = new SimpleFrontEndProcessor();
+            processor.setEnvironment(env);
+            processor.process();
+        }
+    }
+
+    public void checkParams(ErrorVisitor errs) throws ToolException {
+        super.checkParams(errs);
+        CommandDocument doc = super.getCommandDocument();
+
+        if (doc.hasParameter(ToolConstants.CFG_FRONTEND)) {
+            String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
+            if (!ToolConstants.JAXWS_FRONTEND.equals(ft) 
+                && !ToolConstants.SIMPLE_FRONTEND.equals(ft)) {
+                Message msg = new Message("INVALID_FRONTEND", LOG, new Object[] {ft});
+                errs.add(new ErrorVisitor.UserError(msg.toString()));
+            }
+            
+            if (ToolConstants.SIMPLE_FRONTEND.equals(ft) 
+                && doc.getParameter(ToolConstants.CFG_DATABINDING) != null 
+                && !ToolConstants.
+                AEGIS_DATABINDING.equals(doc.getParameter(ToolConstants.CFG_DATABINDING))) {
+                Message msg = new Message("INVALID_DATABINDING_FOR_SIMPLE", LOG);
+                errs.add(new ErrorVisitor.UserError(msg.toString()));
+            }
+            
+        }
+
+        if (doc.hasParameter(ToolConstants.CFG_WRAPPERBEAN)) {
+            String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
+            if (ft != null && !ToolConstants.JAXWS_FRONTEND.equals(ft)) {
+                Message msg = new Message("WRAPPERBEAN_WITHOUT_JAXWS", LOG);
+                errs.add(new ErrorVisitor.UserError(msg.toString()));
+            }
+        }
+        
+        
+        if (errs.getErrors().size() > 0) {
+            Message msg = new Message("PARAMETER_MISSING", LOG);
+            throw new ToolException(msg, new BadUsageException(getUsage(), errs));
+        }
+
+    }
+}

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message