cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r567631 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/toolspec/ javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/ javato/ws/src/main/java/org/apache/cxf/tools/java2ws/ wsdlto/core/src/main/java/or...
Date Mon, 20 Aug 2007 09:55:57 GMT
Author: mmao
Date: Mon Aug 20 02:55:57 2007
New Revision: 567631

URL: http://svn.apache.org/viewvc?rev=567631&view=rev
Log:
CXF-912
Restore the system standard out/err, before tools exit


Modified:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
    incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLContainer.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
    incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
    incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java?rev=567631&r1=567630&r2=567631&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
Mon Aug 20 02:55:57 2007
@@ -32,6 +32,7 @@
 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.CommandLineParser;
+
 public abstract class AbstractToolContainer implements ToolContainer {
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractToolContainer.class);
     
@@ -46,8 +47,9 @@
     private CommandLineParser parser;
     private OutputStream outOutputStream;
     private OutputStream errOutputStream;
-    
-   
+
+    private PrintStream stdOutputStream;
+    private PrintStream stdErrorStream;
  
     public class GenericOutputStream extends OutputStream {
         public void write(int b) throws IOException {
@@ -117,6 +119,9 @@
     }
 
     public void redirectOutput() {
+        stdOutputStream = System.out;
+        stdErrorStream = System.err;
+
         outOutputStream = new GenericOutputStream();
         errOutputStream = new GenericOutputStream();
         System.setErr(new PrintStream(errOutputStream));
@@ -161,6 +166,13 @@
         } catch (BadUsageException bue) {
             throw new ToolException(bue);
         }        
+    }
+
+    public void tearDown() {
+        if (isQuietMode()) {
+            System.setOut(stdOutputStream);
+            System.setErr(stdErrorStream);
+        }
     }
 
 }

Modified: incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLContainer.java?rev=567631&r1=567630&r2=567631&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLContainer.java
(original)
+++ incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDLContainer.java
Mon Aug 20 02:55:57 2007
@@ -73,7 +73,10 @@
             }
 
             throw new ToolException(ex.getMessage(), ex.getCause());
+        } finally {
+            tearDown();
         }
+
     }
 
     public Class getServiceClass(ToolContext context) {

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=567631&r1=567630&r2=567631&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
Mon Aug 20 02:55:57 2007
@@ -77,6 +77,8 @@
             }
 
             throw new ToolException(ex.getMessage(), ex.getCause());
+        } finally {
+            tearDown();
         }
     }
 

Modified: incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?rev=567631&r1=567630&r2=567631&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Mon Aug 20 02:55:57 2007
@@ -240,6 +240,8 @@
             throw ex;
         } catch (Exception ex) {
             throw new ToolException(ex);
+        } finally {
+            tearDown();
         }
     }
 

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java?rev=567631&r1=567630&r2=567631&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
Mon Aug 20 02:55:57 2007
@@ -81,7 +81,10 @@
             if (isVerboseOn()) {
                 ex.printStackTrace();
             }
+        } finally {
+            tearDown();
         }
+
     }
 
     private void validate(ToolContext env) throws ToolException {

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java?rev=567631&r1=567630&r2=567631&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
Mon Aug 20 02:55:57 2007
@@ -83,7 +83,10 @@
             if (isVerboseOn()) {
                 ex.printStackTrace();
             }
+        } finally {
+            tearDown();
         }
+
     }
 
     private void setEnvParamDefValues(ToolContext env) {

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java?rev=567631&r1=567630&r2=567631&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
Mon Aug 20 02:55:57 2007
@@ -83,7 +83,10 @@
             if (isVerboseOn()) {
                 ex.printStackTrace();
             }
+        } finally {
+            tearDown();
         }
+
     }
 
     private void setEnvParamDefValues(ToolContext env) {



Mime
View raw message