|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cacheable
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 |
---|
static final int MAX_REF
Method Detail |
---|
long getKey()
int getReferenceCount()
int incReferenceCount()
int decReferenceCount()
void setReferenceCount(int count)
count
- void setTimestamp(int timestamp)
timestamp
- int getTimestamp()
boolean sync(boolean syncJournal)
boolean allowUnload()
boolean isDirty()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |