cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r578705 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/io/CachedOutputStream.java rt/core/src/main/java/org/apache/cxf/io/CacheAndWriteOutputStream.java rt/core/src/main/java/org/apache/cxf/io/WriteOnCloseOutputStream.java
Date Mon, 24 Sep 2007 08:32:51 GMT
Author: ningjiang
Date: Mon Sep 24 01:32:49 2007
New Revision: 578705

URL: http://svn.apache.org/viewvc?rev=578705&view=rev
Log:
CXF-1059 call the doClose method before the cached stream close, added a postClose method
for close the other stream. Thanks Ryan

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/CacheAndWriteOutputStream.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/WriteOnCloseOutputStream.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java?rev=578705&r1=578704&r2=578705&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java Mon Sep
24 01:32:49 2007
@@ -105,6 +105,13 @@
     protected void doClose() throws IOException {
         
     }
+    
+    /**
+     * Perform any actions required after stream closure (close the other related stream
etc.)
+     */
+    protected void postClose() throws IOException {
+        
+    }
 
     public void close() throws IOException {
         currentStream.flush();
@@ -114,9 +121,11 @@
             }
         }
         
+        doClose();
         currentStream.close();
         dispose();
-        doClose();
+        postClose();
+        
     }
 
     public boolean equals(Object obj) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/CacheAndWriteOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/CacheAndWriteOutputStream.java?rev=578705&r1=578704&r2=578705&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/CacheAndWriteOutputStream.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/CacheAndWriteOutputStream.java
Mon Sep 24 01:32:49 2007
@@ -37,12 +37,13 @@
         flowThroughStream = stream;
     }
 
-    @Override
-    protected void doClose() throws IOException {
+   
+    protected void postClose() throws IOException {
         flowThroughStream.flush();
         flowThroughStream.close();
     }
-
+    
+    
     @Override
     protected void onWrite() throws IOException {
         // does nothing

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/WriteOnCloseOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/WriteOnCloseOutputStream.java?rev=578705&r1=578704&r2=578705&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/WriteOnCloseOutputStream.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/io/WriteOnCloseOutputStream.java
Mon Sep 24 01:32:49 2007
@@ -36,10 +36,11 @@
         flowThroughStream = stream;
     }
 
-    @Override
-    protected void doClose() throws IOException {
+    
+    protected void postClose() throws IOException {
         resetOut(flowThroughStream, true);
         flowThroughStream.flush();
         flowThroughStream.close();
-    }
+    }    
+    
 }



Mime
View raw message