![]() |
Quadcap Embeddable Server |
Inheritance diagram for com.quadcap.util.collections.Cacheable:

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.
Definition at line 53 of file Cacheable.java.
Public Member Functions | |
| void | init (Object store, Object key) throws IOException |
| Initialization and (recycling). | |
| boolean | isDirty () |
| Read the dirty bit. | |
| void | setDirty (boolean d) |
| Set the dirty bit. | |
| int | getRefCount () |
| Read the reference count. | |
| synchronized void | setRefCount (int x) |
| Set the reference count. | |
| synchronized void | incrRefCount () |
| Increment the reference count. | |
| synchronized void | decrRefCount () |
| Decrement the reference count. | |
| void | setDListItem (DListItem d) |
| Set the LRU back pointer. | |
| DListItem | getDListItem () |
| Get the LRU back pointer. | |
| Object | getKey () |
| Get the cache item's key. | |
| void | setKey (Object key) |
| Set the cache item's key. | |
| abstract Object | getData () |
| Get the cache item's data. | |
| abstract void | setData (Object data) |
| Set the cache item's data. | |
| void | flush () throws IOException |
| Flush this item and clear the dirty bit. | |
Protected Attributes | |
| Object | key |
| The key used to locate this item in the underlying store, as well as in the cache itself. | |
| Object | store |
Package Attributes | |
| boolean | dirty = false |
| has object been modified while in the cache? | |
| int | refCount = 0 |
| We reference-count the cache items to know when it's ok to flush older items to make room for new ones. | |
| DListItem | me |
| Back pointer to my place in the LRU list. | |
|
|
Decrement the reference count.
Definition at line 113 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.refCount. Referenced by com.quadcap.util.collections.Cache.get(), and com.quadcap.util.collections.Cache.put(). |
|
|
Flush this item and clear the dirty bit.
Definition at line 148 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.dirty. Referenced by com.quadcap.util.collections.Cache.flush(), and com.quadcap.util.collections.Cache.getCacheable(). |
|
|
Get the cache item's data.
Referenced by com.quadcap.util.collections.Cache.get(). |
|
|
Get the LRU back pointer.
Definition at line 123 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.me. Referenced by com.quadcap.util.collections.Cache.getCacheable(). |
|
|
Get the cache item's key.
Definition at line 128 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.key. Referenced by com.quadcap.util.collections.Cache.checkCache(), and com.quadcap.util.collections.Cache.getCacheable(). |
|
|
Read the reference count.
Definition at line 98 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.refCount. Referenced by com.quadcap.util.collections.Cache.getCacheable(). |
|
|
Increment the reference count.
Definition at line 108 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.refCount. Referenced by com.quadcap.util.collections.Cache.getCacheable(). |
|
||||||||||||
|
Initialization and (recycling).
Definition at line 79 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.dirty, com.quadcap.util.collections.Cacheable.init(), com.quadcap.util.collections.Cacheable.key, and com.quadcap.util.collections.Cacheable.store. Referenced by com.quadcap.util.collections.Cache.getCacheable(), and com.quadcap.util.collections.Cacheable.init(). |
|
|
Read the dirty bit.
Definition at line 88 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.dirty. Referenced by com.quadcap.util.collections.Cache.getCacheable(). |
|
|
Set the cache item's data.
Referenced by com.quadcap.util.collections.Cache.put(). |
|
|
Set the dirty bit.
Definition at line 93 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.dirty, and com.quadcap.util.collections.Cacheable.setDirty(). Referenced by com.quadcap.util.collections.Cacheable.setDirty(). |
|
|
Set the LRU back pointer.
Definition at line 118 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.me, and com.quadcap.util.collections.Cacheable.setDListItem(). Referenced by com.quadcap.util.collections.Cache.getCacheable(), and com.quadcap.util.collections.Cacheable.setDListItem(). |
|
|
Set the cache item's key.
Definition at line 133 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.setKey(). Referenced by com.quadcap.util.collections.Cacheable.setKey(). |
|
|
Set the reference count.
Definition at line 103 of file Cacheable.java. References com.quadcap.util.collections.Cacheable.refCount, and com.quadcap.util.collections.Cacheable.setRefCount(). Referenced by com.quadcap.util.collections.Cacheable.setRefCount(). |
|
|
has object been modified while in the cache?
Definition at line 55 of file Cacheable.java. Referenced by com.quadcap.util.collections.Cacheable.flush(), com.quadcap.util.collections.Cacheable.init(), com.quadcap.util.collections.Cacheable.isDirty(), and com.quadcap.util.collections.Cacheable.setDirty(). |
|
|
The key used to locate this item in the underlying store, as well as in the cache itself.
Definition at line 72 of file Cacheable.java. Referenced by com.quadcap.util.collections.Cacheable.getKey(), and com.quadcap.util.collections.Cacheable.init(). |
|
|
Back pointer to my place in the LRU list.
Definition at line 66 of file Cacheable.java. Referenced by com.quadcap.util.collections.Cacheable.getDListItem(), and com.quadcap.util.collections.Cacheable.setDListItem(). |
|
|
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 Definition at line 63 of file Cacheable.java. Referenced by com.quadcap.util.collections.Cacheable.decrRefCount(), com.quadcap.util.collections.Cacheable.getRefCount(), com.quadcap.util.collections.Cacheable.incrRefCount(), and com.quadcap.util.collections.Cacheable.setRefCount(). |
|
|
Definition at line 74 of file Cacheable.java. Referenced by com.quadcap.util.collections.Cacheable.init(). |