cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: Unifying Sitemap Components API
Date Sun, 04 Mar 2001 21:09:23 GMT
> Webmaster wrote:
> 
> The Action API is not only simple, it is very flexible.  It only has
> one method
> allowing it to be ThreadSafe.  Unfortunately, the regular
> SitemapComponents
> do *not* have the same flexibility.  This causes some traumas in that
> _all_
> sitemap components cannot be Threadsafe.

We are totally aware of this fact. The SAX API which most of the sitemap
Components obey, leads to these interfaces. That's why we have introduce
the Poolable and Recyclable objects to reduve garbage collection.

> The two stage setup(...)->{action}() is the culperate (sp?).  As long
> as a component
> has one initiating method, and does not maintain state between
> subsequent method
> calls (or manages that state), then you can take advantage of lower
> overhead because
> some of the generators and serializers will be able to be made
> ThreadSafe.

I agree for the Generator but not for the Serializer. Because
Serializers are what we call XMLConsumer and thus implement a
ContentHandler they can only be made thread save, if they do not use the
OutputStream.

> It makes it rough to have a personalized method like
> generate()->transform()->serialize()
> but we could do the process(...) method name, and take advantage of
> these optimizations.

I don't see how you can optimize a SAX pipeline to make it thread safe.
But maybe you have seen something I've overlooked. So, feel free to
explain how you'll do it.

Giacomo

Mime
View raw message