|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.excalibur.store.impl.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.
Field Summary |
Fields inherited from interface org.apache.excalibur.store.Store |
PERSISTENT_STORE, ROLE, TRANSIENT_STORE |
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable |
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY |
Constructor Summary | |
MRUMemoryStore()
|
Method Summary | |
void |
clear()
Clear the Store of all elements |
boolean |
containsKey(java.lang.Object key)
Indicates if the given key is associated to a contained object. |
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. |
Instrumentable[] |
getChildInstrumentables()
Any Object which implements Instrumentable can also make use of other Instrumentable child objects. |
java.lang.String |
getInstrumentableName()
Gets the name of the Instrumentable. |
Instrument[] |
getInstruments()
Obtain a reference to all the Instruments that the Instrumentable object wishes to expose. |
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 |
parameterize(Parameters params)
Initialize the MRUMemoryStore. |
void |
remove(java.lang.Object key)
Remove the object associated to the given key. |
void |
service(ServiceManager manager)
Get components of the ComponentLocator |
void |
setInstrumentableName(java.lang.String name)
Sets the name for the Instrumentable. |
int |
size()
Returns count of the objects in the store, or -1 if could not be obtained. |
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.AbstractLogEnabled |
enableLogging, getLogger, 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 service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
manager
- The ComponentLocator
ServiceException
- if an error occurspublic void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
params
- Store parameters
ParameterException
public void dispose()
dispose
in interface Disposable
public void store(java.lang.Object key, java.lang.Object value)
store
in interface Store
key
- The key for the object to storevalue
- The object to storepublic void hold(java.lang.Object key, java.lang.Object value)
key
- The key of the object to be storedvalue
- The object to be storedpublic java.lang.Object get(java.lang.Object key)
get
in interface Store
key
- The key of the requested object
public void remove(java.lang.Object key)
remove
in interface Store
key
- The key of to be removed objectpublic void clear()
clear
in interface Store
public boolean containsKey(java.lang.Object key)
containsKey
in interface Store
key
- The key of the object
public java.util.Enumeration keys()
keys
in interface Store
public int size()
size
in interface Store
public void free()
free
in interface Store
public void setInstrumentableName(java.lang.String name)
Instrumentable
This value may be set by a parent Instrumentable, or by the InstrumentManager using the value of the 'instrumentable' attribute in the configuration of the component.
setInstrumentableName
in interface Instrumentable
name
- The name used to identify a Instrumentable.public java.lang.String getInstrumentableName()
Instrumentable
getInstrumentableName
in interface Instrumentable
public Instrument[] getInstruments()
Instrumentable
getInstruments
in interface Instrumentable
public Instrumentable[] getChildInstrumentables()
Instrumentable
getChildInstrumentables
in interface Instrumentable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |