|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ants.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.
Field Summary | |
static int |
READEXCLUSIVE
|
static int |
READSHARED
|
static int |
WRITEEXCLUSIVE
|
static int |
WRITESHARED
|
Constructor Summary | |
NodeCache(Node owner,
int capacity,
int duration)
|
Method Summary | |
void |
clean()
clean the cache of expired objects |
java.lang.Object |
get(byte[] protocol,
java.lang.Object key)
get another protocols's object from the cache |
java.lang.Object |
get(java.lang.Object key)
get an object from the cache by its key |
int |
getAccess(java.lang.Object key)
get the access flags of an object in the cache by its key |
static void |
main(java.lang.String[] args)
lots of gratuitous testing |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
int time)
put an object in the cache by key, with duration and default access |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
int time,
int access)
put an object in the cache by key, with duration and access |
java.lang.Object |
remove(java.lang.Object key)
remove an object from the cache by its key |
void |
run()
|
boolean |
setAccess(java.lang.Object key,
int access)
set the access flags of an object in the cache by its key |
java.lang.String |
toString()
mainly for testing |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int READSHARED
public static final int READEXCLUSIVE
public static final int WRITESHARED
public static final int WRITEEXCLUSIVE
Constructor Detail |
public NodeCache(Node owner, int capacity, int duration)
Method Detail |
public int getAccess(java.lang.Object key)
public boolean setAccess(java.lang.Object key, int access)
public java.lang.Object get(java.lang.Object key)
public java.lang.Object get(byte[] protocol, java.lang.Object key)
public final java.lang.Object put(java.lang.Object key, java.lang.Object value, int time)
public java.lang.Object put(java.lang.Object key, java.lang.Object value, int time, int access)
public java.lang.Object remove(java.lang.Object key)
public void clean()
public java.lang.String toString()
public void run()
public static void main(java.lang.String[] args) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |