cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <>
Subject Re: Singleton question
Date Tue, 04 Nov 2003 09:58:03 GMT
Leszek Gawron wrote:
> I know this question should be addressed to Avalon group but I am only cocoon
> subscriber and feel much safer with you guys :)
> How should I write an avalon component that is a pure singleton? The case is I
> need a component that has only ONE instance and the access is strictly
> synchronized. The component cannot be pooled because AFAIU the pool can grow
> over it's maximum size set in cocoon.xconf. 
> Normally I would implement a singleton with synchronized methods but I would
> like to make it cocoon exercise and make this a component with full lifecycle.

Implement the lifecycle interface ThreadSafe.
The CM will always return the same instance

View raw message