| |
|
| java.lang.Object com.quadcap.util.collections.Cacheable
All known Subclasses: com.quadcap.http.servlets.file.HttpFile,
Cacheable | abstract public class Cacheable extends Object (Code) | | The construction of these objects needs to be managed by the
cache object. They are initialized using the anonymous 'store'
object; it is the responsibility of the derived class to cast
the anonymous store to the correct type.
author: Stan Bailes |
Field Summary | |
boolean | dirty | protected Object | key The key used to locate this item in the underlying store, as well
as in the cache itself. | DListItem | me Back pointer to my place in the LRU list. | int | refCount We reference-count the cache items to know when it's ok to flush
older items to make room for new ones. | protected Object | store |
dirty | boolean dirty(Code) | | has object been modified while in the cache?
|
key | protected Object key(Code) | | The key used to locate this item in the underlying store, as well
as in the cache itself.
|
refCount | int refCount(Code) | | We reference-count the cache items to know when it's ok to flush
older items to make room for new ones. We should probably keep
some statistics which keep track of the percentage of cache items
currently "in-use"; i.e., with refCount > 0
|
decrRefCount | public synchronized void decrRefCount()(Code) | | Decrement the reference count
|
flush | public void flush() throws IOException(Code) | | Flush this item and clear the dirty bit.
|
getDListItem | public DListItem getDListItem()(Code) | | Get the LRU back pointer.
|
getData | abstract public Object getData()(Code) | | Get the cache item's data.
|
getKey | public Object getKey()(Code) | | Get the cache item's key.
|
getRefCount | public int getRefCount()(Code) | | Read the reference count
|
incrRefCount | public synchronized void incrRefCount()(Code) | | Increment the reference count
|
isDirty | public boolean isDirty()(Code) | | Read the dirty bit.
|
setDListItem | public void setDListItem(DListItem d)(Code) | | Set the LRU back pointer.
|
setData | abstract public void setData(Object data)(Code) | | Set the cache item's data.
|
setDirty | public void setDirty(boolean d)(Code) | | Set the dirty bit.
|
setKey | public void setKey(Object key)(Code) | | Set the cache item's key.
|
setRefCount | public synchronized void setRefCount(int x)(Code) | | Set the reference count
|
|
|
|