|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.apache.cocoon.store.MemoryStore
This class implements a memory-managed hashtable wrapper that uses a weighted mix of LRU and LFU to keep track of object importance. NOTE: this class is _HIGHLY_ un-optimized and this class is _CRITICAL_ for a fast performance of the whole system. So, if you find any better way to implement this class (clever data models, smart update algorithms, etc...), please, consider patching this implementation or sending a note about a method to do it.
| Constructor Summary | |
MemoryStore()
|
|
| Method Summary | |
boolean |
containsKey(java.lang.Object key)
Indicates if the given key is associated to a contained object. |
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. |
java.lang.String |
getStatus()
Returns the signature of this store implementation |
void |
hold(java.lang.Object key,
java.lang.Object object)
Holds the given object in a volatile state. |
void |
init(Configurations conf)
Initialize the MemoryStore. |
java.util.Enumeration |
list()
Returns the list of used keys. |
void |
remove(java.lang.Object key)
Remove the object associated to the given key and returns the object associated to the given key or null if not found. |
void |
run()
Background memory check. |
void |
store(java.lang.Object key,
java.lang.Object value)
Store the given object in a persistent state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MemoryStore()
| Method Detail |
public void init(Configurations conf)
throws InitializationException
init in interface Configurablepublic void run()
run in interface java.lang.Runnable
public void store(java.lang.Object key,
java.lang.Object value)
store in interface Store
public void hold(java.lang.Object key,
java.lang.Object object)
hold in interface Storepublic java.lang.Object get(java.lang.Object key)
get in interface Storepublic void remove(java.lang.Object key)
remove in interface Storepublic boolean containsKey(java.lang.Object key)
containsKey in interface Storepublic java.util.Enumeration list()
list in interface Storepublic void free()
free in interface Storepublic java.lang.String getStatus()
getStatus in interface Status
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||