net.sf.ehcache
Class ElementData

java.lang.Object
  extended by net.sf.ehcache.ElementData
All Implemented Interfaces:
Externalizable, Serializable, org.terracotta.toolkit.internal.cache.TimestampedValue
Direct Known Subclasses:
EternalElementData, NonEternalElementData

public abstract class ElementData
extends Object
implements Externalizable, org.terracotta.toolkit.internal.cache.TimestampedValue

Serialized representation of net.sf.ehcache.Element

Author:
Nishant
See Also:
Serialized Form

Field Summary
protected  boolean cacheDefaultLifespan
           
protected  long creationTime
           
protected  long hitCount
           
protected  long lastAccessTime
           
protected  long lastUpdateTime
           
protected  Object value
           
protected  long version
           
 
Constructor Summary
ElementData()
           
ElementData(Element element)
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected volatile Object value

version

protected volatile long version

creationTime

protected volatile long creationTime

lastAccessTime

protected volatile long lastAccessTime

hitCount

protected volatile long hitCount

cacheDefaultLifespan

protected volatile boolean cacheDefaultLifespan

lastUpdateTime

protected volatile long lastUpdateTime
Constructor Detail

ElementData

public ElementData()

ElementData

public ElementData(Element element)
Method Detail

createElement

public abstract Element createElement(Object key)
This method should return the Element object constructed from fields of this ElementData.

Parameters:
key - the key which the returned Element object should have.
Returns:
the Element object constructed from this ElementData.

writeAttributes

protected abstract void writeAttributes(ObjectOutput oos)
                                 throws IOException
The subclasses must implement this method to persist any subclass specific attribute while serialization
It will be called when this object is being serialized.

Parameters:
oos - the ObjectOutput object on which the attributes must be written
Throws:
IOException

readAttributes

protected abstract void readAttributes(ObjectInput in)
                                throws IOException
The subclasses must implement this method to read any subclass specific attributes while deserialization
It will be called when this object is being deserialized.

Parameters:
in - the ObjectInput object from which the attributes must be read.
Throws:
IOException

writeExternal

public void writeExternal(ObjectOutput oos)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

getValue

public Object getValue()

getLastAccessedTime

public int getLastAccessedTime()

setLastAccessedTimeInternal

protected void setLastAccessedTimeInternal(int usedAtTime)

getCreateTime

public int getCreateTime()

updateTimestamps

public void updateTimestamps(int createTime,
                             int lastAccessedTime)
Specified by:
updateTimestamps in interface org.terracotta.toolkit.internal.cache.TimestampedValue


Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.