org.terracotta.cache.serialization
Class SerializedEntry<T>
java.lang.Object
org.terracotta.cache.value.AbstractStatelessTimestampedValue<V>
org.terracotta.cache.value.AbstractTimestampedValue<byte[]>
org.terracotta.cache.serialization.SerializedEntry<T>
- All Implemented Interfaces:
- TimestampedValue<byte[]>
- Direct Known Subclasses:
- CustomLifespanSerializedEntry
public class SerializedEntry<T>
- extends AbstractTimestampedValue<byte[]>
Wrapper class around the serialized cache entries. This handles the serialization and de-serialization of the cache
entries, and also the local caching (in a transient reference) of the de-serialized value.
SerializedEntry
public SerializedEntry(T deserialized,
byte[] serialized,
TimeSource timeSource)
SerializedEntry
public SerializedEntry(T deserialized,
byte[] serialized,
int createTime)
SerializedEntry
public SerializedEntry(T deserialized,
byte[] serialized,
int createTime,
int lastAccessedTime)
getDeserializedValueCopy
public T getDeserializedValueCopy(SerializationStrategy<T> strategy)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
getDeserializedValueCopy
public T getDeserializedValueCopy(SerializationStrategy<T> strategy,
ClassLoader classLoader)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
getDeserializedValue
public T getDeserializedValue(SerializationStrategy<T> strategy)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
getDeserializedValue
public T getDeserializedValue(SerializationStrategy<T> strategy,
ClassLoader classLoader)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
nullByteArray
public void nullByteArray()
getCreateTime
public int getCreateTime()
- Description copied from interface:
TimestampedValue
- Retrieves the time when this value was created.
- Specified by:
getCreateTime in interface TimestampedValue<byte[]>- Specified by:
getCreateTime in class AbstractStatelessTimestampedValue<byte[]>
- Returns:
- this value's creation time in seconds since epoch
getValue
public byte[] getValue()
- Description copied from interface:
TimestampedValue
- Get the actual value in the cache.
- Specified by:
getValue in interface TimestampedValue<byte[]>- Specified by:
getValue in class AbstractStatelessTimestampedValue<byte[]>
- Returns:
- The value
Copyright © 2010 Terracotta, Inc.. All Rights Reserved.