Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 91770 invoked from network); 24 Sep 2007 08:33:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Sep 2007 08:33:16 -0000 Received: (qmail 22872 invoked by uid 500); 24 Sep 2007 08:33:07 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 22841 invoked by uid 500); 24 Sep 2007 08:33:07 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 22832 invoked by uid 99); 24 Sep 2007 08:33:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Sep 2007 01:33:07 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Sep 2007 08:35:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F30731A9832; Mon, 24 Sep 2007 01:32:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: cxf-commits@incubator.apache.org From: ningjiang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070924083252.F30731A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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(); - } + } + }