cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <>
Subject RE: [c2] Implementation advice needed!
Date Sun, 02 Sep 2001 15:04:04 GMT
> Hi,
> following problem:
> I'm just implementing a new component (StoreJanitor).
> I inserted a new role in the cocoon.roles:
> <role name=""
>        shorthand="store-janitor"
>        default-class=""/>
> I lookup this role in the MRUMemoryStore:
> getLogger().debug("Looking up " + StoreJanitor.ROLE);
>       this.storejanitor = (StoreJanitor)manager.lookup(StoreJanitor.ROLE);
> Then I want to call a method in the configure() method of the MRUMemoryStore
> this.storejanitor.register(this);
> The problem is that the MRUMemoryStore is instanced twice (for the EventCache
> and the StreamCache) and with the implementation above the StoreJanitor twice too. 
> But I want that the StoreJanitor is a "Singelton" and every Store instance 
> can register to this class.
> How can I implement with Avalon such singelton classes?

I'm just a bloody beginner but AFAI understood: if the StoreJanitor implements
ThreadSafe (don't know if this is possible) there should be only ONE instance

To unsubscribe, e-mail:
For additional commands, email:

View raw message