cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: [C2] Problem with component pools.
Date Fri, 23 Feb 2001 16:47:16 GMT
Davanum Srinivas wrote:
> Berin,
> The "pools" Hashmap in both CocoonComponentSelector and DefaultComponentManager are keyed
off the
> just the Class and *NOT* the hint/role. The hint/role is ignored completely when we do
a pools.get
> or a pools.put. (For example in DefaultComponentManager lines 261 and 279)
> The problem is with SVGSerializer which acts both as "svg2jpeg" and "svg2png". We always
get the
> same pool back as pools Hashmap uses the class SVGSerializer as the key.


I see the problem.  This is much like the issue with ThreadSafe Components that was solved
In theory, every hint reflects a distinct Class.  In practice, we can have a single class
that has
differing configuration information.  It is more efficient to pool already set up components
of virgin components--otherwise we loose the benefit of pooling.

Ok, We will make the ComponentManager/Selector be keyed off the role/hint every time.  This
is the
classic question of distinction: When is a Component a different Role/Hint and when is it
the same
Role/Hint?  The practical answer is this:

Any time a Component has to be made distinct (i.e. serialize to PNG vs. JPG, or the different
we have floating around), it needs to be completely distinct by role or hint down to the instance
retrieved from the ComponentManager/Selectors.

View raw message