Author: bimargulies Date: Tue Apr 8 18:21:06 2008 New Revision: 646169 URL: http://svn.apache.org/viewvc?rev=646169&view=rev Log: Create mechanism for controlling logging in the tools.
Added: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java (with props) incubator/cxf/trunk/tools/common/src/main/resources/org/ incubator/cxf/trunk/tools/common/src/main/resources/org/apache/ incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/ incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/ incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/ incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties (with props) Modified: incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/extensions/WSDL2JavaTask.java incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java Modified: incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/extensions/WSDL2JavaTask.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/extensions/WSDL2JavaTask.java?rev=646169&r1=646168&r2=646169&view=diff ============================================================================== --- incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/extensions/WSDL2JavaTask.java (original) +++ incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/extensions/WSDL2JavaTask.java Tue Apr 8 18:21:06 2008 @@ -33,9 +33,32 @@ import org.apache.tools.ant.taskdefs.LogStreamHandler; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; - +/** + * Ant task for wsdl2java + */ public class WSDL2JavaTask extends CxfAntTask { + /* + * For reference, here's the usage message from the command-line. + * wsdl2java -fe <frontend name>* + * -db <data binding name>* + * -wv <[wsdl version]>* + * -p <[wsdl namespace =]Package Name>* + * -sn <service-name> -b <binding-name>* + * -catalog <catalog-file-name> + * -d <output-directory> + * -compile -classdir <compile-classes-directory> + * -impl -server -client -all + * -defaultValues<=class name for DefaultValueProvider> + * -ant + * -nexclude <schema namespace [= java packagename]>* + * -exsh <enable extended soap header message binding (true, false)> + * -dns <Default value is true> + * -dex <Default value is true> -validate -keep + * -wsdlLocation <wsdlLocation attribute> -xjc<xjc arguments> + * -noAddressBinding -h -v -verbose -quiet <wsdlurl> + */ + private String wsdlLocation; private String wsdl; private Set<File> bindingFiles = new HashSet<File>(); Added: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java?rev=646169&view=auto ============================================================================== --- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java (added) +++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java Tue Apr 8 18:21:06 2008 @@ -0,0 +1,52 @@ +/** + * 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.common; + +import java.io.IOException; +import java.io.InputStream; +import java.util.logging.LogManager; + +/** + * This class provides common functionality for the main functions for the tools, as used from shell scripts + * or ant. + */ +public final class CommandInterfaceUtils { + + private CommandInterfaceUtils() { + } + + public static void commandCommonMain() { + // force commons-logging into j.u.l so we can + // configure it. + System.setProperty("org.apache.commons.logging.Log", + "org.apache.commons.logging.impl.Jdk14Logger"); + InputStream commandConfig = CommandInterfaceUtils.class + .getResourceAsStream("commandLogging.properties"); + try { + try { + LogManager.getLogManager().readConfiguration(commandConfig); + } finally { + commandConfig.close(); + } + } catch (IOException ioe) { + throw new RuntimeException(ioe); + } + } +} Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties?rev=646169&view=auto ============================================================================== --- incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties (added) +++ incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties Tue Apr 8 18:21:06 2008 @@ -0,0 +1,22 @@ +# 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. + +handlers= java.util.logging.ConsoleHandler +java.util.logging.ConsoleHandler.level = INFO +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter +.level= WARNING +#org.apache.cxf.level=INFO Propchange: incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: incubator/cxf/trunk/tools/common/src/main/resources/org/apache/cxf/tools/common/commandLogging.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java?rev=646169&r1=646168&r2=646169&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java (original) +++ incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java Tue Apr 8 18:21:06 2008 @@ -24,6 +24,7 @@ import java.util.List; import org.apache.cxf.common.util.StringUtils; +import org.apache.cxf.tools.common.CommandInterfaceUtils; import org.apache.cxf.tools.common.ToolConstants; import org.apache.cxf.tools.common.ToolContext; import org.apache.cxf.tools.common.ToolException; @@ -165,6 +166,7 @@ public static void main(String[] pargs) { + CommandInterfaceUtils.commandCommonMain(); WSDLToJava w2j = new WSDLToJava(pargs); try {