cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: More than one lifecycle interface
Date Tue, 18 Oct 2005 06:44:50 GMT
Ralph Goers wrote:
> No, but it makes sense since they each have characterstics that are 
> incompatible with each other.
> SingleThreaded implies that the class is a singleton and is not thread 
> safe and should essentially be executed in a serial fashion (a huge 
> bottleneck).

SingleThreaded doesn't mean singleton! It means that the class is not 
reentrant and not reusable, leading the system to create a new instance 
each time the component is looked up. This is also the default for 
component that implement no lifestyle interface.

> ThreadSafe - the class is rentrant and can be executed by multiple 
> threads simultaneously.

And in this is a singleton, as only one instance is created and used for 
all requets.

> Poolable - Each thread should get its own instance of the class and 
> that there should be a pool of them from which they are doled out.

Yup. Add to the picture Recyclable which extends Poolable for pooled 
components that want to be notified that they are recycled, e.g. for 
cleaning up their state.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message