cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject question on trax serializers
Date Wed, 04 Apr 2001 08:48:56 GMT
hey guys, i was playing around with adding caching to c2, just of the
final output - i was going to profile it on my local box and see what sort
of performance increase (or decrease) it resulted in. my sort of take on
it was to modify ResourcePipeline and have it pass a ByteArrayOutputStream
to the serializer instead of the environment's OutputStream. fair enough,
but how do we know when the serializer is finished? i don't think it's
sufficient to have called generator.generate(), because the various
sitemap components might (almost certainly will) fire off threads to do
their jobs. so i wrote me a little OutputStream wrapper class to notify me
when OutputStream.close() is called:

package org.apache.cocoon.util;


public class NotifyingOutputStream extends FilterOutputStream {

  protected Object recipient;
  protected boolean isClosed = false;

  public NotifyingOutputStream (OutputStream output, Object recipient) {
    this.recipient = recipient;

  public void close() throws IOException {
    isClosed = true;

  public boolean isClosed() {
    return isClosed;


and i wait() on the recipient Object in ResourcePipeline until the close()
method is called and i'm notified. seems simple enough, but the close()
method is never called. isn't it the job of the trax serializer to close
the OutputStream when it's finished?

- donald

To unsubscribe, e-mail:
For additional commands, email:

View raw message