tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Casey Lucas" <>
Subject tag handler pooling ideas
Date Thu, 08 Mar 2001 00:59:45 GMT

I am planning on implementing tag handler pooling and would like
to throw out a few ideas for feedback:

- Tag handlers can only be reused if the same set of attributes
are used for the tag.

- Tag.relese is called only once -- at some point before the
handler is garbage collected.

basic idea:
My general idea was to have a collection of named pools.  Jasper
could then render code to use the named pool to obtain handler
instances instead of newing them each time.

more info:
Each tag handler pool would have a name that would include
the tag's short name and the set of attributes that were used
on the tag.  This would give us the correct reuse level.  So
for the following tags there would be two named pools (after
taking into account attributes):

<x:tag1 attr1="a" attr2="b"/>
<x:tag1 attr1="xyz" attr2="123"/>
<x:tag1 attr1="a"/>

To eliminate the need to lookup the pool by name each time a
tag was needed, pool references could be rendered and initialized
(looked up) when the jsp is initialized.  Inside the main jsp
method (_jspService), the pool references would be used directly.

When the pools are removed (shutdown, reload, etc.) Tag.release
will be called for each of the handlers.  I assume that pools need
to be per web application, but haven't given it a lot of thought.

Any comments / suggestions?


View raw message