You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@sundn.de> on 2000/11/29 12:13:25 UTC

[C2]: Dispose of sitemap components

Hi,

what do you think of a dispose() method for each sitemap component (generator, transformer, serializer etc) as an equivalent to the setup() method?

The dispose() method would be called after the pipeline has finished and each component has the chance to clean up.
This is especially important if an exception occurs in the pipeline: If the generator throws an exception none of the following components get aware of this. 
If for example the SQLTransformer has already opened the connection this will never be closed properly, because if the components are pooled they will not garbage collected.

If there is interest I would write voluntarely the patches for the components (adding a dispose() method with no parameters).

Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================


Re: [C2]: Patch for HTMLGenerator

Posted by Paul Russell <pa...@luminas.co.uk>.
On Mon, Dec 04, 2000 at 01:23:55PM +0100, Carsten Ziegeler wrote:
> The compilation of the HTMLGenerator is optional and only invoked if
> your classpath contains the Tidy.jar.

D'oh. Permission to feel stupid? I'll check it out.


P.

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

AW: [C2]: Patch for HTMLGenerator

Posted by Carsten Ziegeler <cz...@sundn.de>.
The compilation of the HTMLGenerator is optional and only invoked if
your classpath contains the Tidy.jar.

Carsten

> -----Ursprungliche Nachricht-----
> Von: Paul Russell [mailto:paulr@luminas.co.uk]Im Auftrag von Paul
> Russell
> Gesendet: Montag, 4. Dezember 2000 13:20
> An: cocoon-dev@xml.apache.org
> Betreff: Re: [C2]: Patch for HTMLGenerator
> 
> 
> On Mon, Dec 04, 2000 at 12:48:52PM +0100, Carsten Ziegeler wrote:
> > Hello.
> > This patch updates the HTMLGenerator to the currently used avalon api. 
> > Otherwise compiling would result in errors.
> 
> Carsten,
> 
> I've just updated my C2 tree to make sure I'm using the latest
> version of the repository, and everything seems to compile fine
> (even after a build clean).... Anything specific giving you
> troubles?
> 
> 
> Paul
> 
> -- 
> Paul Russell                               <pa...@luminas.co.uk>
> Technical Director,                   http://www.luminas.co.uk
> Luminas Ltd.


Re: [C2]: Patch for HTMLGenerator

Posted by Paul Russell <pa...@luminas.co.uk>.
On Mon, Dec 04, 2000 at 12:48:52PM +0100, Carsten Ziegeler wrote:
> Hello.
> This patch updates the HTMLGenerator to the currently used avalon api. 
> Otherwise compiling would result in errors.

Carsten,

I've just updated my C2 tree to make sure I'm using the latest
version of the repository, and everything seems to compile fine
(even after a build clean).... Anything specific giving you
troubles?


Paul

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

[C2]: Patch for HTMLGenerator

Posted by Carsten Ziegeler <cz...@sundn.de>.
Hello.

This patch updates the HTMLGenerator to the currently used avalon api. 
Otherwise compiling would result in errors.

Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================

Re: [C2]: Dispose of sitemap components

Posted by Paul Russell <pa...@luminas.co.uk>.
On Thu, Nov 30, 2000 at 09:13:28AM -0500, Vadim Gritsenko wrote:
> BTW, why don't use avalon's contextualize(Context) from Contextualizable
> instead of Cocoon-specific setup(...,...,...)?

Yeah, seems sensible to me.

> And, it seems to me, when component is going back to pool recycle() should
> be used.

They already are.


P.
-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: [C2]: Dispose of sitemap components

Posted by Berin Loritsch <bl...@infoplanning.com>.
----- Original Message ----- 
From: "Vadim Gritsenko" <vg...@hns.com>
To: <co...@xml.apache.org>
Sent: Thursday, November 30, 2000 9:13 AM
Subject: RE: [C2]: Dispose of sitemap components


> > -----Original Message-----
> > From: giacomo@hns.com [mailto:giacomo@hns.com]On Behalf Of Giacomo Pati
> > Sent: Thursday, November 30, 2000 1:46 AM
> > To: cocoon-dev@xml.apache.org
> > Subject: Re: [C2]: Dispose of sitemap components
> >
> >
> > Berin Loritsch wrote:
> > >
> > > ----- Original Message -----
> > > From: Carsten Ziegeler <cz...@sundn.de>
> > > To: <co...@xml.apache.org>
> > > Sent: Wednesday, November 29, 2000 6:13 AM
> > > Subject: [C2]: Dispose of sitemap components
> > >
> > > > Hi,
> > >
> > > > what do you think of a dispose() method for each sitemap component
> > > (generator, transformer, serializer etc) as an equivalent to the setup()
> > > method?
> > >
> > > Quick question: why setup()?  Avalon has the Initializable
> > interface with
> > > init() that is for the same purpose.
> >
> > Well, it's not setup() but setup(...., ...., ....) and it's used to pass
> > run time request parameters and alike to a component before calling its
> > generate/transfor/serialize functionality. Is this the same purpose as
> > init() was meant to?
> 
> init() and dispose() methods should be called once in component's lifecycle
> (according to
> avalon docs), init() after configure() and compose(), dispose() before
> fnialize().
> 
> BTW, why don't use avalon's contextualize(Context) from Contextualizable
> instead of Cocoon-specific setup(...,...,...)?
> And, it seems to me, when component is going back to pool recycle() should
> be used.

You are absolutely correct.  If I said anything that could be understood
any other way then I was _wrong_.  I am switching between two open source
projects and three proprietary projects, and it is hard to keep them all
straight.


RE: [C2]: Dispose of sitemap components

Posted by Vadim Gritsenko <vg...@hns.com>.
> -----Original Message-----
> From: giacomo@hns.com [mailto:giacomo@hns.com]On Behalf Of Giacomo Pati
> Sent: Thursday, November 30, 2000 1:46 AM
> To: cocoon-dev@xml.apache.org
> Subject: Re: [C2]: Dispose of sitemap components
>
>
> Berin Loritsch wrote:
> >
> > ----- Original Message -----
> > From: Carsten Ziegeler <cz...@sundn.de>
> > To: <co...@xml.apache.org>
> > Sent: Wednesday, November 29, 2000 6:13 AM
> > Subject: [C2]: Dispose of sitemap components
> >
> > > Hi,
> >
> > > what do you think of a dispose() method for each sitemap component
> > (generator, transformer, serializer etc) as an equivalent to the setup()
> > method?
> >
> > Quick question: why setup()?  Avalon has the Initializable
> interface with
> > init() that is for the same purpose.
>
> Well, it's not setup() but setup(...., ...., ....) and it's used to pass
> run time request parameters and alike to a component before calling its
> generate/transfor/serialize functionality. Is this the same purpose as
> init() was meant to?

init() and dispose() methods should be called once in component's lifecycle
(according to
avalon docs), init() after configure() and compose(), dispose() before
fnialize().

BTW, why don't use avalon's contextualize(Context) from Contextualizable
instead of Cocoon-specific setup(...,...,...)?
And, it seems to me, when component is going back to pool recycle() should
be used.


> > > The dispose() method would be called after the pipeline has
> finished and
> > each component has the chance to clean up.
> > > This is especially important if an exception occurs in the
> pipeline: If
> > the generator throws an exception none of the following
> components get aware
> > of this.
> > > If for example the SQLTransformer has already opened the
> connection this
> > will never be closed properly, because if the components are pooled they
> > will not garbage collected.
> >
> > absolutely.  The Pipeline objects are basically one time use, and then
> > thrown away.
> >
> > > If there is interest I would write voluntarely the patches for the
> > components (adding a dispose() method with no parameters).
>
> Giacomo

Thanks,
Vadim


Re: [C2]: Dispose of sitemap components

Posted by Giacomo Pati <gi...@apache.org>.
Berin Loritsch wrote:
> 
> ----- Original Message -----
> From: Carsten Ziegeler <cz...@sundn.de>
> To: <co...@xml.apache.org>
> Sent: Wednesday, November 29, 2000 6:13 AM
> Subject: [C2]: Dispose of sitemap components
> 
> > Hi,
> 
> > what do you think of a dispose() method for each sitemap component
> (generator, transformer, serializer etc) as an equivalent to the setup()
> method?
> 
> Quick question: why setup()?  Avalon has the Initializable interface with
> init() that is for the same purpose.

Well, it's not setup() but setup(...., ...., ....) and it's used to pass
run time request parameters and alike to a component before calling its
generate/transfor/serialize functionality. Is this the same purpose as
init() was meant to?

> 
> > The dispose() method would be called after the pipeline has finished and
> each component has the chance to clean up.
> > This is especially important if an exception occurs in the pipeline: If
> the generator throws an exception none of the following components get aware
> of this.
> > If for example the SQLTransformer has already opened the connection this
> will never be closed properly, because if the components are pooled they
> will not garbage collected.
> 
> absolutely.  The Pipeline objects are basically one time use, and then
> thrown away.
> 
> > If there is interest I would write voluntarely the patches for the
> components (adding a dispose() method with no parameters).

Giacomo

AW: [C2]: Dispose of sitemap components

Posted by Carsten Ziegeler <cz...@sundn.de>.
> 
> > what do you think of a dispose() method for each sitemap component
> (generator, transformer, serializer etc) as an equivalent to the setup()
> method?
> 
> Quick question: why setup()?  Avalon has the Initializable interface with
> init() that is for the same purpose.
> 
With setup() I meant the setup(EntityResolver resolver, Map objectModel, String src, Parameters par)
method of the SitemapModelComponent interface. So this method is cocoon-related and has additional
parameters. Therefore Initializable cannot be used here.

Carsten


Re: [C2]: Dispose of sitemap components

Posted by Berin Loritsch <bl...@infoplanning.com>.
----- Original Message -----
From: Carsten Ziegeler <cz...@sundn.de>
To: <co...@xml.apache.org>
Sent: Wednesday, November 29, 2000 6:13 AM
Subject: [C2]: Dispose of sitemap components


> Hi,

> what do you think of a dispose() method for each sitemap component
(generator, transformer, serializer etc) as an equivalent to the setup()
method?

Quick question: why setup()?  Avalon has the Initializable interface with
init() that is for the same purpose.

> The dispose() method would be called after the pipeline has finished and
each component has the chance to clean up.
> This is especially important if an exception occurs in the pipeline: If
the generator throws an exception none of the following components get aware
of this.
> If for example the SQLTransformer has already opened the connection this
will never be closed properly, because if the components are pooled they
will not garbage collected.

absolutely.  The Pipeline objects are basically one time use, and then
thrown away.

> If there is interest I would write voluntarely the patches for the
components (adding a dispose() method with no parameters).