|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.components.store.MRUMemoryStore
This class provides a cache algorithm for the requested documents. It combines a HashMap and a LinkedList to create a so called MRU (Most Recently Used) cache. The idea was taken from the "Writing Advanced Application Tutorial" from javasoft. Many thanx to the writers!
Fields inherited from interface org.apache.cocoon.components.store.Store |
ROLE |
Constructor Summary | |
MRUMemoryStore()
|
Method Summary | |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
Get components of the ComponentManager |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
Initialize the MRUMemoryStore. |
boolean |
containsKey(java.lang.Object key)
Indicates if the given key is associated to a contained object. |
void |
contextualize(org.apache.avalon.framework.context.Context context)
Get the context |
void |
dispose()
Dispose the component |
void |
free()
Frees some of the fast memory used by this store. |
java.lang.Object |
get(java.lang.Object key)
Get the object associated to the given unique key. |
void |
hold(java.lang.Object key,
java.lang.Object value)
This method holds the requested object in a HashMap combined with a LinkedList to create the MRU. |
java.util.Enumeration |
keys()
Returns the list of used keys as an Enumeration. |
void |
remove(java.lang.Object key)
Remove the object associated to the given key. |
void |
store(java.lang.Object key,
java.lang.Object value)
Store the given object in a persistent state. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MRUMemoryStore()
Method Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager manager) throws org.apache.avalon.framework.component.ComponentException
compose
in interface org.apache.avalon.framework.component.Composable
the
- ComponentManagerpublic void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
the
- Context of the applicationpublic void configure(org.apache.avalon.framework.configuration.Configuration conf) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
the
- Configuration of the applicationorg.apache.avalon.framework.configuration.ConfigurationException
- public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
public void store(java.lang.Object key, java.lang.Object value)
store
in interface Store
the
- key for the object to storethe
- object to storepublic void hold(java.lang.Object key, java.lang.Object value)
hold
in interface Store
the
- key of the object to be storedthe
- object to be storedpublic java.lang.Object get(java.lang.Object key)
get
in interface Store
the
- key of the requested objectpublic void remove(java.lang.Object key)
remove
in interface Store
the
- key of to be removed objectpublic boolean containsKey(java.lang.Object key)
containsKey
in interface Store
the
- key of the objectpublic java.util.Enumeration keys()
keys
in interface Store
public void free()
free
in interface Store
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |