[2002-11-14 00:56 +0100] Stephen McConnell ([EMAIL PROTECTED]) wrote:
> Gary Shea wrote:
>
> >If I understand the way pooling should work, I can inform merlin in the
> >Type specification that a particular component should have a pooled
> >lifestyle. What I'm not finding is a way to tell it what ObjectFactory
> >to use. Is this a reasonable desire, or am I missing something?
> >
>
> You don't need to declare a factory, just the lifestyle policy. The
> following type declaration within a component .xinfo file shows the
> usage of a pooled lifestyle policy.
>
> <type>
>
> <info>
> <name>demonstratable</name>
> <attributes>
> <attribute key="avalon:lifestyle" value="pooled"/>
> </attributes>
> </info>
>
> <!-- other stuff -->
>
> </type>
>
> Possible lifestyle parameter values include ~"pooled", "thread",
> "transient", and singleton". More inforation about the respective
> policies in inlcuded at the end of the page on the following link:
>
> http://jakarta.apache.org/avalon/excalibur/container/attributes.html
>
> Cheers, Steve.
Yep, I found the avalon:lifestyle key, and the values it accepts,
albeit the hard way -- digging through the code. Using the doc would be
way too easy.
Finally figured out what I was missing -- I was thinking
object-centrically. The current code uses a pooled object, which is
produced by a (static) factory. I suspect the right way to do this is
have the component use the factory to get the object, so the component
is basically a facade for the object. Then the pooling code can create
the components as needed, and never need to know about the factory.
Gary
--
To unsubscribe, e-mail: <mailto:avalon-users-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-users-help@;jakarta.apache.org>