cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Froehlich" <g-froehl...@gmx.de>
Subject [c2] Implementation advice needed!
Date Thu, 13 Sep 2001 14:51:52 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?

Cheers
Gerhard



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


Mime
View raw message