To keep cached data, Cocoon uses components implementing the org.apache.excalibur.Store interface. Cocoon uses two implementations of this interface, the transient store and the store, and optionally a third one, the persistent store.

Transient store

The transient store (role Store.TRANSIENT_STORE) is used for objects that are not serializable, or whose storage doesn't make sense across server restart. The transient store lives on its own and has no relation with other stores. This is a mandatory component within Cocoon (i.e. used by Cocoon's code).

Cocoon uses the transient store to cache XSLT style sheets, XSP logicsheets, etc.

Store (aka. "main Store")

The store (role Store.ROLE) is used to store objects that are serializable. As the transient store, it is a mandatory component. For efficiency reasons, implementations of the main store should keep most-often used objects in memory and swap older ones to disk.

Cocoon uses the main store to cache pipeline output.

Persistent store (optional)

Some store (Store.ROLE) implementations (but not all) may actually be just an in-memory cache that swap objects by calling the persistent store (Store.PERSISTENT_STORE) when needed. So the persistent store is an optional component which is used only by MRU!MemoryStore, and nowhere else in the code.

Two examples to illustrate this:

To sum up :

-- SylvainWallez

StoreComponents (last edited 2009-09-20 23:43:06 by localhost)