|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bees.core.NodeCache
Node cache of managed soft-state.
Combines hashtable and doubly linked list to implement fixed size table with LRU replacement. all public entry points are synchronized. a background gc thread cleans entries that have expired.
XXX the background GC thread is probably unnecessary since this is only per-domain state. At the least, the background thread should be configurable by the domain (e.g., its collection parameters).
XXX should this class be final? Should more methods be marked final? (e.g., get)
This differs from the original version in that it does not have a maximum time limit or a maximum number of cached items, both of which are unneeded because of per-domain resource limits.
Inner Class Summary | |
static interface |
NodeCache.EventHandler
Elements of this type in the node cache will receive calls when one of a set of events occurs. |
Constructor Summary | |
NodeCache(Node owner,
int size)
Construct a NodeCache with the given values. |
Method Summary | |
java.lang.Object |
get(int i)
Overloaded get method for integer keys. |
java.lang.Object |
get(long l)
Overloaded get method for long keys. |
java.lang.Object |
get(java.lang.Object key)
Return the value paired with a certain key |
Node |
getOwnerNode()
|
java.lang.Object[] |
keys()
|
java.lang.Object |
put(int i,
java.lang.Object value,
IntegerPermission time)
Overloaded put method for integer keys. |
java.lang.Object |
put(long l,
java.lang.Object value,
IntegerPermission time)
Overloaded put method for long keys. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
IntegerPermission time)
Add a key/value pair to the cache with a given expiration time. |
boolean |
refresh(java.lang.Object key,
IntegerPermission time)
|
java.lang.Object |
remove(java.lang.Object key)
Remove an association from the cache. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NodeCache(Node owner, int size)
owner
- The Node that owns this NodeCache instancesize
- The size of the hash tableMethod Detail |
public final Node getOwnerNode()
public final java.lang.Object get(java.lang.Object key)
key
- The key to search forpublic final java.lang.Object put(java.lang.Object key, java.lang.Object value, IntegerPermission time)
key
- The key for identifying the valuevalue
- The value to be trackedtime
- The expiration time for this associationpublic boolean refresh(java.lang.Object key, IntegerPermission time)
public java.lang.Object remove(java.lang.Object key)
key
- Key for the association to removepublic final java.lang.Object get(int i)
public final java.lang.Object put(int i, java.lang.Object value, IntegerPermission time)
public final java.lang.Object get(long l)
public final java.lang.Object put(long l, java.lang.Object value, IntegerPermission time)
public final java.lang.Object[] keys()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |