|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ref.Reference
java.lang.ref.SoftReference
com.oroad.stxx.cache.CacheWrapper
Simple wrapper for an object that wants to be cached.
| Constructor Summary | |
CacheWrapper(java.lang.Object id,
long expiryTime,
long modTime,
java.lang.Object o)
Wraps an object to cache |
|
CacheWrapper(java.lang.Object id,
long expiryTime,
java.lang.Object o)
Wraps an object to cache |
|
| Method Summary | |
long |
getExpiryTime()
Gets the time (in milliseconds) when this object will expire |
java.lang.Object |
getIdentifier()
Gets the identifier for the object |
long |
getLastAccessedTime()
Gets the last accessed time in milliseconds |
long |
getLastModifiedTime()
Gets the time the object was last modified |
java.lang.Object |
getWrapped()
Gets the wrapped object |
boolean |
isExpired()
Gets whether the cached object is expired |
void |
setLastAccessedTime(long time)
Sets the last time this object was accessed |
void |
setLastModifiedTime(long time)
Sets the last modified time |
| Methods inherited from class java.lang.ref.SoftReference |
get |
| Methods inherited from class java.lang.ref.Reference |
clear, enqueue, isEnqueued |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CacheWrapper(java.lang.Object id,
long expiryTime,
java.lang.Object o)
id - The unique identifier of the objectexpiryTime - The expiration time as a timestampo - The object to cache
public CacheWrapper(java.lang.Object id,
long expiryTime,
long modTime,
java.lang.Object o)
id - The unique identifier of the objectexpiryTime - The expiration time as a timestampmodTime - The last modified time as a timestampo - The object to cache| Method Detail |
public void setLastModifiedTime(long time)
setLastModifiedTime in interface Cacheabletime - The last modified time in millisecondspublic long getLastModifiedTime()
getLastModifiedTime in interface Cacheablepublic java.lang.Object getIdentifier()
getIdentifier in interface Cacheablepublic long getLastAccessedTime()
getLastAccessedTime in interface Cacheablepublic void setLastAccessedTime(long time)
setLastAccessedTime in interface Cacheabletime - Time in millisecondspublic long getExpiryTime()
getExpiryTime in interface Cacheablepublic java.lang.Object getWrapped()
public boolean isExpired()
isExpired in interface Cacheable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||