public abstract class ElementData extends Object implements Externalizable, org.terracotta.toolkit.internal.cache.TimestampedValue
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cacheDefaultLifespan |
protected long |
creationTime |
protected long |
hitCount |
protected long |
lastAccessTime |
protected long |
lastUpdateTime |
protected Object |
value |
protected long |
version |
| Constructor and Description |
|---|
ElementData() |
ElementData(Element element) |
| Modifier and Type | Method and Description |
|---|---|
abstract Element |
createElement(Object key)
This method should return the
Element object constructed from fields of this ElementData. |
int |
getCreateTime() |
int |
getLastAccessedTime() |
Object |
getValue() |
protected abstract void |
readAttributes(ObjectInput in)
The subclasses must implement this method to read any subclass specific attributes while deserialization
It will be called when this object is being deserialized. |
void |
readExternal(ObjectInput in) |
protected void |
setLastAccessedTimeInternal(int usedAtTime) |
void |
updateTimestamps(int createTime,
int lastAccessedTime) |
protected abstract void |
writeAttributes(ObjectOutput oos)
The subclasses must implement this method to persist any subclass specific attribute while serialization
It will be called when this object is being serialized. |
void |
writeExternal(ObjectOutput oos) |
protected volatile Object value
protected volatile long version
protected volatile long creationTime
protected volatile long lastAccessTime
protected volatile long hitCount
protected volatile boolean cacheDefaultLifespan
protected volatile long lastUpdateTime
public ElementData()
public ElementData(Element element)
public abstract Element createElement(Object key)
Element object constructed from fields of this ElementData.key - the key which the returned Element object should have.protected abstract void writeAttributes(ObjectOutput oos) throws IOException
oos - the ObjectOutput object on which the attributes must be writtenIOExceptionprotected abstract void readAttributes(ObjectInput in) throws IOException
in - the ObjectInput object from which the attributes must be read.IOExceptionpublic void writeExternal(ObjectOutput oos) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic Object getValue()
public int getLastAccessedTime()
protected void setLastAccessedTimeInternal(int usedAtTime)
public int getCreateTime()
public void updateTimestamps(int createTime,
int lastAccessedTime)
updateTimestamps in interface org.terracotta.toolkit.internal.cache.TimestampedValueCopyright © 2003–2024 Terracotta, Inc.. All rights reserved.