|
||||||||||
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 cachepublic 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 cacheMethod Detail |
public void setLastModifiedTime(long time)
setLastModifiedTime
in interface Cacheable
time
- The last modified time in millisecondspublic long getLastModifiedTime()
getLastModifiedTime
in interface Cacheable
public java.lang.Object getIdentifier()
getIdentifier
in interface Cacheable
public long getLastAccessedTime()
getLastAccessedTime
in interface Cacheable
public void setLastAccessedTime(long time)
setLastAccessedTime
in interface Cacheable
time
- Time in millisecondspublic long getExpiryTime()
getExpiryTime
in interface Cacheable
public 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 |