|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.caching.impl.AbstractDoubleMapEventRegistry
public abstract class AbstractDoubleMapEventRegistry
This abstract base implementation of EventRegistry stores
the event-key mappings in a simple pair of MultiMaps. It
leaves all persistence to its concrete subclasses. To protect against
future confusing inheritance trees, all internal implementation of the
event-key mapping mechanism is hidden from its subclasses. If future
EventRegistry implementations desire to use a different event-key mapping
strategy but share persistence code, this package should probably be
refactored to employ composition rather than inheritance. For now,
simplicity favors inheritance.
| Field Summary |
|---|
| Fields inherited from interface org.apache.cocoon.caching.EventRegistry |
|---|
ROLE |
| Constructor Summary | |
|---|---|
AbstractDoubleMapEventRegistry()
|
|
| Method Summary | |
|---|---|
Serializable[] |
allKeys()
Return all pipeline keys mapped to any event |
void |
clear()
Remove all registered data. |
protected void |
createBlankCache()
|
protected void |
createMultiMaps()
|
void |
dispose()
Delegate persistence to subclasses then clean up resources. |
void |
initialize()
Recover state by de-serializing the data wrapper. |
Serializable[] |
keysForEvent(Event e)
Retrieve all pipeline keys mapped to this event. |
protected abstract void |
persist(EventRegistryDataWrapper wrapper)
An EventRegistry must persist its data. |
protected abstract boolean |
recover()
An EventRegistry must recover its persisted data. |
void |
register(Event e,
Serializable key)
Registers (stores) a two-way mapping between this Event and this PipelineCacheKey for later retrieval. |
void |
removeKey(Serializable key)
When a CachedResponse is removed from the Cache, any entries in the event mapping must be cleaned up. |
protected void |
unwrapRegistry(EventRegistryDataWrapper ecdw)
|
boolean |
wasRecoverySuccessful()
Returns whether the registry was successful in retrieving its persisted state during startup. |
protected EventRegistryDataWrapper |
wrapRegistry()
|
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDoubleMapEventRegistry()
| Method Detail |
|---|
public void register(Event e,
Serializable key)
register in interface EventRegistrye - The event tokey - keypublic void clear()
clear in interface EventRegistrypublic Serializable[] keysForEvent(Event e)
keysForEvent in interface EventRegistrye - event
public Serializable[] allKeys()
allKeys in interface EventRegistrypublic void removeKey(Serializable key)
removeKey in interface EventRegistrykey - - The key to remove.
public void initialize()
throws Exception
initialize in interface InitializableExceptionpublic void dispose()
dispose in interface Disposablepublic boolean wasRecoverySuccessful()
EventRegistry
wasRecoverySuccessful in interface EventRegistryprotected EventRegistryDataWrapper wrapRegistry()
protected void unwrapRegistry(EventRegistryDataWrapper ecdw)
protected final void createBlankCache()
protected void createMultiMaps()
protected abstract boolean recover()
protected abstract void persist(EventRegistryDataWrapper wrapper)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||