|
||||||||
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 |
long |
getTime(java.lang.Object key)
Gets the time this object was added. |
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. |
boolean |
memoryLow()
|
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 Configurable
public void run()
run
in interface java.lang.Runnable
public boolean memoryLow()
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 Store
public java.lang.Object get(java.lang.Object key)
get
in interface Store
public long getTime(java.lang.Object key) throws java.lang.NullPointerException
getTime
in interface Store
java.lang.NullPointerException
- if the object is not in the store.public void remove(java.lang.Object key)
remove
in interface Store
public boolean containsKey(java.lang.Object key)
containsKey
in interface Store
public java.util.Enumeration list()
list
in interface Store
public void free()
free
in interface Store
public java.lang.String getStatus()
getStatus
in interface Status
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |