You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Art Welch <ar...@EASTPOINT.COM> on 2001/09/17 18:26:34 UTC

FW: cvs commit: xml-fop/src/org/apache/fop/render/xml XMLRenderer .java

Keiron,

I wonder if NULLing _source, _stream, and _reader in Driver.reset() is such
a good idea. For my own use with the PCLRenderer I take advantage of the
stream staying open to concatenate multiple invocations into one output. I
suppose that the desired things could be saved off before calling reset
(since thankfully you do not call close() or anything) and then put them
back after. But this seems like a bit of a nuisance. But maybe I am the only
one that does this. I know that for most of the other renderers it is not
currently possible to concatenate multiple invocations in FOP. Just a
though.

Art

-----Original Message-----
From: keiron@apache.org [mailto:keiron@apache.org]
Sent: Monday, September 17, 2001 9:30 AM
To: xml-fop-cvs@apache.org
Subject: cvs commit: xml-fop/src/org/apache/fop/render/xml
XMLRenderer.java


keiron      01/09/17 06:29:53

  Modified:    src/org/apache/fop/apps AWTStarter.java
                        CommandLineOptions.java Driver.java
               src/org/apache/fop/render AbstractRenderer.java
                        PrintRenderer.java
               src/org/apache/fop/render/awt AWTRenderer.java
               src/org/apache/fop/render/mif MIFRenderer.java
               src/org/apache/fop/render/ps PSRenderer.java
               src/org/apache/fop/render/xml XMLRenderer.java
  Log:
  fixed a few awt render problems and a bit more render refactoring
  
...
  
  Index: Driver.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Driver.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Driver.java	2001/08/22 08:29:17	1.34
  +++ Driver.java	2001/09/17 13:29:52	1.35
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Driver.java,v 1.34 2001/08/22 08:29:17 keiron Exp $
  + * $Id: Driver.java,v 1.35 2001/09/17 13:29:52 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights
reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -230,6 +230,9 @@
        */
       public synchronized void reset() {
           _areaTree = null;
  +        _source = null;
  +        _stream = null;
  +        _reader = null;
           _treeBuilder.reset();
       }
   

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FW: cvs commit: xml-fop/src/org/apache/fop/render/xml XMLRenderer .java

Posted by Keiron Liddle <ke...@aftexsw.com>.
Art,

The point of view I was thinking of is that the driver should be put back
into the state it started with (from the no argument constructor) and that
it shouldn't hold onto things if it is going to be reused. This means that
it uses a minimum of memory while it is idle.
I would argue that because the structure was not created by the Driver and
it was set externally then it should not hold a reference to it. If you
want to hold onto the driver and let the output stream get garbage
collected then the caller of driver is able to controll that.

In your situation you are still able to set the output stream again. I
wouldn't think making that one call is too inconvenient unless there is
something I don't know about.

As for asking for an npe, that will hapen if you create a new driver with
the no argument constructor then call render.

As for the bug, I think this is due to the renderer not being reset (which
it is now in the current cvs).



On Mon, 17 Sep 2001 18:26:34 Art Welch wrote:
> Keiron,
> 
> I wonder if NULLing _source, _stream, and _reader in Driver.reset() is
> such
> a good idea. For my own use with the PCLRenderer I take advantage of the
> stream staying open to concatenate multiple invocations into one output.
> I
> suppose that the desired things could be saved off before calling reset
> (since thankfully you do not call close() or anything) and then put them
> back after. But this seems like a bit of a nuisance. But maybe I am the
> only
> one that does this. I know that for most of the other renderers it is not
> currently possible to concatenate multiple invocations in FOP. Just a
> though.
> 
> Art

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org