net.sf.ehcache
Class AbstractElementData
java.lang.Object
org.terracotta.cache.value.AbstractStatelessTimestampedValue<Object>
net.sf.ehcache.AbstractElementData
- All Implemented Interfaces:
- TimestampedValue<Object>
- Direct Known Subclasses:
- IdentityModeElementData, SerializationModeElementData
public abstract class AbstractElementData
- extends AbstractStatelessTimestampedValue<Object>
- Author:
- Alex Snaps
|
Constructor Summary |
protected |
AbstractElementData(Object value,
long version,
long creationTime,
long lastAccessTime,
long hitCount,
boolean cacheDefaultLifespan,
int timeToLive,
int timeToIdle,
long lastUpdateTime)
|
value
protected final Object value
version
protected final long version
creationTime
protected final long creationTime
lastAccessTime
protected long lastAccessTime
hitCount
protected final long hitCount
cacheDefaultLifespan
protected final boolean cacheDefaultLifespan
timeToLive
protected final int timeToLive
timeToIdle
protected final int timeToIdle
lastUpdateTime
protected final long lastUpdateTime
AbstractElementData
protected AbstractElementData(Object value,
long version,
long creationTime,
long lastAccessTime,
long hitCount,
boolean cacheDefaultLifespan,
int timeToLive,
int timeToIdle,
long lastUpdateTime)
setCapacityEvictionPolicyData
public abstract void setCapacityEvictionPolicyData(CapacityEvictionPolicyData capacityEvictionPolicyData)
- Description copied from interface:
TimestampedValue
- Sets this value's capacity eviction policy data.
- Parameters:
capacityEvictionPolicyData - the new data
getCapacityEvictionPolicyData
public abstract CapacityEvictionPolicyData getCapacityEvictionPolicyData()
- Description copied from interface:
TimestampedValue
- Retrieves this value's capacity eviction policy data.
- Returns:
- this value's data
fastGetCapacityEvictionPolicyData
protected abstract CapacityEvictionPolicyData fastGetCapacityEvictionPolicyData()
- Specified by:
fastGetCapacityEvictionPolicyData in class AbstractStatelessTimestampedValue<Object>
createElement
public net.sf.ehcache.Element createElement(Object key)
write
public void write(ObjectOutputStream oos)
throws IOException
- Throws:
IOException
getValue
public Object getValue()
- Description copied from interface:
TimestampedValue
- Get the actual value in the cache.
- Specified by:
getValue in interface TimestampedValue<Object>- Specified by:
getValue in class AbstractStatelessTimestampedValue<Object>
- Returns:
- The value
getLastAccessedTime
public int getLastAccessedTime()
- Description copied from interface:
TimestampedValue
- Retrieves the time when this value was last accessed.
- Specified by:
getLastAccessedTime in interface TimestampedValue<Object>- Specified by:
getLastAccessedTime in class AbstractStatelessTimestampedValue<Object>
- Returns:
- this value's last access time in seconds since epoch
setLastAccessedTimeInternal
protected void setLastAccessedTimeInternal(int usedAtTime)
- Specified by:
setLastAccessedTimeInternal in class AbstractStatelessTimestampedValue<Object>
getCreateTime
public int getCreateTime()
- Description copied from interface:
TimestampedValue
- Retrieves the time when this value was created.
- Specified by:
getCreateTime in interface TimestampedValue<Object>- Specified by:
getCreateTime in class AbstractStatelessTimestampedValue<Object>
- Returns:
- this value's creation time in seconds since epoch
expiresAt
public int expiresAt(CacheConfig config)
- Description copied from class:
AbstractStatelessTimestampedValue
- Get the time at which this timestamp will become invalid. If the config specified ttl == tti == 0, making items
eternal, then this method returns
TimestampedValue.NEVER_EXPIRE.
- Specified by:
expiresAt in interface TimestampedValue<Object>- Overrides:
expiresAt in class AbstractStatelessTimestampedValue<Object>
- Parameters:
config - The configuration
- Returns:
- Timestamp of expiration, >0, may be NEVER_EXPIRE if eternal
Copyright © 2010 Terracotta, Inc.. All Rights Reserved.