| java.lang.Object snaq.util.TimeWrapper
TimeWrapper | public class TimeWrapper implements Cacheable(Code) | | Wrapper for an object, useful for providing caching/pooling support.
See Also: snaq.util.CacheManager See Also: snaq.util.ObjectPool author: Giles Winstanley |
Method Summary | |
long | getAccessed() Returns the time this object was last accessed. | public Object | getId() Returns the object's identifier. | public Object | getObject() Returns the object referenced by this wrapper. | public synchronized boolean | isExpired() Whether this item has expired. | synchronized void | setLiveTime(long expiryTime) Sets idle time allowed before this item expires. | synchronized void | updateAccessed() Updates the time this object was last accessed. |
TimeWrapper | public TimeWrapper(Object id, Object obj, long expiryTime)(Code) | | Creates a new wrapped object.
Parameters: id - identifier object Parameters: obj - object to be referenced Parameters: expiryTime - object's idle time before death in milliseconds (0 - eternal) |
getAccessed | long getAccessed()(Code) | | Returns the time this object was last accessed.
|
getId | public Object getId()(Code) | | Returns the object's identifier.
|
getObject | public Object getObject()(Code) | | Returns the object referenced by this wrapper.
|
isExpired | public synchronized boolean isExpired()(Code) | | Whether this item has expired.
(Expiry of zero indicates that it will never expire)
|
setLiveTime | synchronized void setLiveTime(long expiryTime)(Code) | | Sets idle time allowed before this item expires.
Parameters: expiryTime - idle time before expiry (0 = eternal) |
updateAccessed | synchronized void updateAccessed()(Code) | | Updates the time this object was last accessed.
|
|
|