You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Stephen McConnell <mc...@osm.net> on 2002/03/03 23:06:43 UTC
Pool interface question
Concerning the interface org.apache.avalon.excalibur.mpool.Pool.
1. I acquire an object
2. I get instance A
3. I acquire another object B
4. if A == B, and I have not released A, I presume that this
would constitute an illegal state
Can anyone confirm this?
Steve.
Stephen J. McConnell, OSM sarl
digital products for a global economy
http://www.osm.net
mailto:mcconnell@osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Pool interface question
Posted by Leo Sutic <le...@inspireinfrastructure.com>.
> From: Stephen McConnell [mailto:mcconnell@osm.net]
>
> Concerning the interface org.apache.avalon.excalibur.mpool.Pool.
>
> 1. I acquire an object
> 2. I get instance A
> 3. I acquire another object B
> 4. if A == B, and I have not released A, I presume that this
> would constitute an illegal state
>
> Can anyone confirm this?
Yes. Pooled components are not used by more than one client at a time,
and it should be possible to grab two of them.
For example:
interface MyPooledComponent {
/**
* Call this one just as you obtain the component.
*/
public void A ();
/**
* Must be called after A.
*/
public void B ();
/**
* Must be called after B.
*/
public void C ();
}
(In Cocoon, MyPooledComponent -> Transformer, MyPooledComponent.A ->
Transformer.setup,
so this is a real-life use case. One should be able to grab two transformers
to
create a pipeline.)
/LS
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>