org.apache.cocoon.caching.impl
Class DefaultEventRegistryImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.caching.impl.AbstractDoubleMapEventRegistry
          extended by org.apache.cocoon.caching.impl.DefaultEventRegistryImpl
All Implemented Interfaces:
Disposable, Initializable, Component, Contextualizable, LogEnabled, ThreadSafe, EventRegistry

public class DefaultEventRegistryImpl
extends AbstractDoubleMapEventRegistry
implements EventRegistry, Contextualizable

This implementation of EventRegistry handles persistence by serializing an EventRegistryDataWrapper to disk.

Since:
2.1
Version:
$Id: DefaultEventRegistryImpl.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Geoff Howard

Field Summary
 
Fields inherited from interface org.apache.cocoon.caching.EventRegistry
ROLE
 
Constructor Summary
DefaultEventRegistryImpl()
           
 
Method Summary
 void contextualize(Context context)
          Set up the persistence file.
protected  void persist(EventRegistryDataWrapper registryWrapper)
          Persist by simple object serialization.
protected  boolean recover()
          An EventRegistry must recover its persisted data.
 
Methods inherited from class org.apache.cocoon.caching.impl.AbstractDoubleMapEventRegistry
allKeys, clear, createBlankCache, createMultiMaps, dispose, initialize, keysForEvent, register, removeKey, unwrapRegistry, wasRecoverySuccessful, 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
 
Methods inherited from interface org.apache.cocoon.caching.EventRegistry
allKeys, clear, keysForEvent, register, removeKey, wasRecoverySuccessful
 

Constructor Detail

DefaultEventRegistryImpl

public DefaultEventRegistryImpl()
Method Detail

contextualize

public void contextualize(Context context)
                   throws ContextException
Set up the persistence file.

Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

persist

protected void persist(EventRegistryDataWrapper registryWrapper)
Persist by simple object serialization. If the serialization fails, an error is logged but not thrown because missing/invalid state is handled at startup.

Specified by:
persist in class AbstractDoubleMapEventRegistry

recover

protected boolean recover()
Description copied from class: AbstractDoubleMapEventRegistry
An EventRegistry must recover its persisted data. Failed recovery must be signaled so that the Cache will know not to serve potentially stale content. Of course, at first start up failed recovery is a normal state.

Specified by:
recover in class AbstractDoubleMapEventRegistry
Returns:
boolean to signal success or failure of recovery.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.