Gary Shea wrote:

[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.

Yep - conceptually, you factory is providing a sub-set of the functionality of an appliance (see other email). One of the benefits of adistinct instance at the appliance level is that it is not the actual component - just the service acess point as far as a container is concerned. Your appliance implementation can delay service activation until the service is actually needed - and can do nice things like abstrat out the service activation mechanism (i.e. componet X does not need to implement an interface just to provide a service - there are other multiple appoaches that this level of seperation enables).

Cheers, Steve.



Gary


--
To unsubscribe, e-mail: <mailto:avalon-users-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-users-help@;jakarta.apache.org>




--

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@;osm.net
http://www.osm.net




--
To unsubscribe, e-mail:   <mailto:avalon-users-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-users-help@;jakarta.apache.org>

Reply via email to