cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltriel...@apache.org
Subject svn commit: r472455 - in /cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks: BlockConnection.java DispatcherServlet.java util/BlockCallHttpServletResponse.java
Date Wed, 08 Nov 2006 11:52:20 GMT
Author: ltrieloff
Date: Wed Nov  8 03:52:18 2006
New Revision: 472455

URL: http://svn.apache.org/viewvc?view=rev&rev=472455
Log:
Fix problem in cleanup of SitemapComponents when using blocks. Patch by Alexander Klimetschek,
fixes COCOON-1948


Modified:
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/util/BlockCallHttpServletResponse.java

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java?view=diff&rev=472455&r1=472454&r2=472455
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
(original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockConnection.java
Wed Nov  8 03:52:18 2006
@@ -117,6 +117,8 @@
             
             byte[] out = os.toByteArray();
             
+            os.close();
+            
             return new ByteArrayInputStream(out);
         } catch (ServletException e) {
             throw new CascadingIOException("BlockConnection " + e.getMessage(), e);

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java?view=diff&rev=472455&r1=472454&r2=472455
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java
(original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/DispatcherServlet.java
Wed Nov  8 03:52:18 2006
@@ -34,6 +34,7 @@
 import javax.servlet.http.HttpServletRequestWrapper;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.cocoon.ProcessingUtil;
 import org.springframework.beans.BeanWrapperImpl;
 import org.springframework.beans.factory.BeanFactoryUtils;
 import org.springframework.beans.factory.ListableBeanFactory;
@@ -113,6 +114,8 @@
                 " servletPath=" + request.getServletPath() +
                 " pathInfo=" + request.getPathInfo());
         servlet.service(request, res);
+
+        ProcessingUtil.cleanup();
     }
     
     private void getInterfaces(Set interfaces, Class clazz) {

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/util/BlockCallHttpServletResponse.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/util/BlockCallHttpServletResponse.java?view=diff&rev=472455&r1=472454&r2=472455
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/util/BlockCallHttpServletResponse.java
(original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/util/BlockCallHttpServletResponse.java
Wed Nov  8 03:52:18 2006
@@ -144,6 +144,12 @@
 
         if (this.servletStream == null) {
             this.servletStream = new ServletOutputStream() {
+                /* (non-Javadoc)
+                 * @see java.io.OutputStream#flush()
+                 */
+                public void flush() throws IOException {
+                    BlockCallHttpServletResponse.this.outputStream.flush();
+                }
 
                 /* (non-Javadoc)
                  * @see java.io.OutputStream#write(int)
@@ -151,6 +157,19 @@
                 public void write(int b) throws IOException {
                     BlockCallHttpServletResponse.this.outputStream.write(b);
                 }
+
+                /* (non-Javadoc)
+                 * @see java.io.OutputStream#close()
+                 * 
+                 * This method is probably never called, the close will be
+                 * initiated directly on this.outputStream by the one who set
+                 * it via BlockCallHttpServletResponse.setOutputStream()
+                 */
+                public void close() throws IOException {
+                    BlockCallHttpServletResponse.this.outputStream.close();
+                }
+                
+                
             };
         }
  
@@ -271,7 +290,8 @@
     }
 
     public void setOutputStream(OutputStream outputStream) {
-        this.outputStream = outputStream;        }
+        this.outputStream = outputStream;
+    }
 
     /* (non-Javadoc)
      * @see javax.servlet.http.HttpServletResponse#setStatus(int)



Mime
View raw message