|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.keel.services.cache.turbine.CachedObject
Wrapper for an object you want to store in a cache for a period of time.
| Field Summary | |
private java.lang.Object |
contentsThe object to be cached. |
protected long |
createdWhen created. |
static int |
DEFAULTCache the object with the Default TTL |
private long |
defaultageDefault age (30 minutes). |
private long |
expiresWhen it expires. |
static int |
FOREVERDo not expire the object |
private boolean |
staleIs this object stale/expired? |
| Constructor Summary | |
CachedObject(java.lang.Object o)Constructor; sets the object to expire in the default time (30 minutes). |
|
CachedObject(java.lang.Object o, long expires)Constructor. |
|
| Method Summary | |
java.lang.Object |
getContents()Returns the cached object. |
long |
getCreated()Returns the creation time for the object. |
long |
getExpires()Returns the expiration time for the object. |
boolean |
getStale()Get the stale status for the object. |
boolean |
isStale()Is the object stale? |
void |
setExpires(long expires)Set the expiration interval for the object. |
void |
setStale(boolean stale)Set the stale status for the object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT
public static final int FOREVER
private java.lang.Object contents
private long defaultage
protected long created
private long expires
private boolean stale
| Constructor Detail |
public CachedObject(java.lang.Object o)
o - The object you want to cache.
public CachedObject(java.lang.Object o,
long expires)
o - The object to cache.expires - How long before the object expires, in ms, e.g. 1000 = 1 second.| Method Detail |
public java.lang.Object getContents()
public long getCreated()
public long getExpires()
public void setExpires(long expires)
expires - Expiration interval in millis ( 1 second = 1000 millis)public void setStale(boolean stale)
stale - Whether the object is stale or not.public boolean getStale()
public boolean isStale()
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||