org.terracotta.cache.value
Class DefaultTimestampedValue<V>

java.lang.Object
  extended by org.terracotta.cache.value.AbstractStatelessTimestampedValue<V>
      extended by org.terracotta.cache.value.AbstractTimestampedValue<V>
          extended by org.terracotta.cache.value.DefaultTimestampedValue<V>
All Implemented Interfaces:
ExpirableEntry, MarkTimestampedValue, TimestampedValue<V>

public class DefaultTimestampedValue<V>
extends AbstractTimestampedValue<V>

Wraps a value in the map-evictor and adds an expiration timestamp for entries. Tracks timestamp information on when the idle and TTL timers for a CacheData value will expire. The TTL timer (timeToDie) cannot be reset, but may not be active. The idle timer is reset each time the item is used.


Field Summary
 
Fields inherited from class org.terracotta.cache.value.AbstractTimestampedValue
lastAccessedTime
 
Fields inherited from class org.terracotta.cache.value.AbstractStatelessTimestampedValue
UNUSED
 
Fields inherited from interface org.terracotta.cache.TimestampedValue
NEVER_EXPIRE
 
Constructor Summary
DefaultTimestampedValue(V value, int createTime)
           
 
Method Summary
 int getCreateTime()
          Retrieves the time when this value was created.
 V getValue()
          Get the actual value in the cache.
 
Methods inherited from class org.terracotta.cache.value.AbstractTimestampedValue
fastGetCapacityEvictionPolicyData, getCapacityEvictionPolicyData, getLastAccessedTime, setCapacityEvictionPolicyData, setLastAccessedTimeInternal
 
Methods inherited from class org.terracotta.cache.value.AbstractStatelessTimestampedValue
equals, expiresAt, expiresAt, hashCode, isExpired, markUsed, markUsed, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTimestampedValue

public DefaultTimestampedValue(V value,
                               int createTime)
Method Detail

getValue

public final V getValue()
Description copied from interface: TimestampedValue
Get the actual value in the cache.

Specified by:
getValue in interface TimestampedValue<V>
Specified by:
getValue in class AbstractStatelessTimestampedValue<V>
Returns:
The value

getCreateTime

public int getCreateTime()
Description copied from interface: TimestampedValue
Retrieves the time when this value was created.

Specified by:
getCreateTime in interface TimestampedValue<V>
Specified by:
getCreateTime in class AbstractStatelessTimestampedValue<V>
Returns:
this value's creation time in seconds since epoch


Copyright © 2015 Terracotta, Inc.. All Rights Reserved.