| java.lang.Object org.apache.turbine.services.cache.CachedObject
All known Subclasses: org.apache.turbine.services.cache.RefreshableCachedObject,
Field Summary | |
final public static int | DEFAULT | final public static int | FOREVER | protected long | created When created. |
Constructor Summary | |
public | CachedObject(Object o) Constructor; sets the object to expire in the default time (30
minutes). | public | CachedObject(Object o, long expires) Constructor.
Parameters: o - The object to cache. Parameters: expires - How long before the object expires, in ms,e.g. |
Method Summary | |
public Object | getContents() Returns the cached object. | public long | getCreated() Returns the creation time for the object. | public long | getExpires() Returns the expiration time for the object. | public synchronized boolean | getStale() Get the stale status for the object. | public synchronized boolean | isStale() | public void | setExpires(long expires) Set the expiration interval for the object. | public synchronized void | setStale(boolean stale) Set the stale status for the object. |
DEFAULT | final public static int DEFAULT(Code) | | Cache the object with the Default TTL
|
FOREVER | final public static int FOREVER(Code) | | Do not expire the object
|
created | protected long created(Code) | | When created. *
|
CachedObject | public CachedObject(Object o)(Code) | | Constructor; sets the object to expire in the default time (30
minutes).
Parameters: o - The object you want to cache. |
CachedObject | public CachedObject(Object o, long expires)(Code) | | Constructor.
Parameters: o - The object to cache. Parameters: expires - How long before the object expires, in ms,e.g. 1000 = 1 second. |
getContents | public Object getContents()(Code) | | Returns the cached object.
The cached object. |
getCreated | public long getCreated()(Code) | | Returns the creation time for the object.
When the object was created. |
getExpires | public long getExpires()(Code) | | Returns the expiration time for the object.
When the object expires. |
getStale | public synchronized boolean getStale()(Code) | | Get the stale status for the object.
Whether the object is stale or not. |
isStale | public synchronized boolean isStale()(Code) | | Is the object stale?
True if the object is stale. |
setExpires | public void setExpires(long expires)(Code) | | Set the expiration interval for the object.
Parameters: expires - Expiration interval in millis ( 1 second = 1000 millis) |
setStale | public synchronized void setStale(boolean stale)(Code) | | Set the stale status for the object.
Parameters: stale - Whether the object is stale or not. |
|
|