cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject RE: [C2]: Dispose of sitemap components
Date Thu, 30 Nov 2000 14:13:28 GMT
> -----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 <cziegeler@sundn.de>
> > To: <cocoon-dev@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


Mime
View raw message