|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Implemented by all objects that should be stored into a cache. Each object should provide a unique key, an internal reference counter, and a timestamp marker (used to measure how long the object has stayed in the cache). It depends on the concrete cache implementation if and how these fields are used.
Field Summary | |
static int |
MAX_REF
|
Method Summary | |
boolean |
allowUnload()
Is it safe to unload the Cacheable from the cache? Called before an object is actually removed. |
int |
decReferenceCount()
Decrease the reference count of this object by one and return it. |
long |
getKey()
Get a unique key for the object. |
int |
getReferenceCount()
Get the current reference count. |
int |
getTimestamp()
Get the current timestamp marker. |
int |
incReferenceCount()
Increase the reference count of this object by one and return it. |
boolean |
isDirty()
|
void |
setReferenceCount(int count)
Set the reference count of this object. |
void |
setTimestamp(int timestamp)
Set the timestamp marker. |
boolean |
sync(boolean syncJournal)
Called before the object is released by the cache. |
Field Detail |
public static final int MAX_REF
Method Detail |
public long getKey()
public int getReferenceCount()
public int incReferenceCount()
public int decReferenceCount()
public void setReferenceCount(int count)
count
- public void setTimestamp(int timestamp)
timestamp
- public int getTimestamp()
public boolean sync(boolean syncJournal)
public boolean allowUnload()
public boolean isDirty()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |