cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <tcu...@dff.st>
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="org.apache.cocoon.components.store.StoreJanitor"
>        shorthand="store-janitor"
>        default-class="org.apache.cocoon.components.store.StoreJanitorImpl"/>
> 
> 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
--
Torsten

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


Mime
View raw message