org.codehaus.wadi.core.eviction
Class SimpleEvictable

java.lang.Object
  extended by org.codehaus.wadi.core.eviction.SimpleEvictable
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Evictable
Direct Known Subclasses:
AbstractMotable

public abstract class SimpleEvictable
extends java.lang.Object
implements Evictable, java.io.Externalizable

A very Simple impementation of Evictable

Version:
$Revision: 2244 $
Author:
Jules Gosnell
See Also:
Serialized Form

Field Summary
protected  SimpleEvictableMemento memento
           
 
Constructor Summary
SimpleEvictable()
           
 
Method Summary
 void copy(Evictable evictable)
           
 void destroy()
           
 long getCreationTime()
           
 long getLastAccessedTime()
           
 int getMaxInactiveInterval()
           
 boolean getTimedOut(long time)
           
 long getTimeToLive(long time)
           
 void init(long creationTime, long lastAccessedTime, int maxInactiveInterval)
           
 void mote(Evictable recipient)
           
protected  SimpleEvictableMemento newMemento()
           
protected  void onDeserialization()
           
protected  void onSerialization()
           
 void readExternal(java.io.ObjectInput oi)
           
 void setLastAccessedTime(long lastAccessedTime)
           
 void setMaxInactiveInterval(int maxInactiveInterval)
           
 void writeExternal(java.io.ObjectOutput oo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memento

protected SimpleEvictableMemento memento
Constructor Detail

SimpleEvictable

public SimpleEvictable()
Method Detail

newMemento

protected SimpleEvictableMemento newMemento()

init

public void init(long creationTime,
                 long lastAccessedTime,
                 int maxInactiveInterval)
Specified by:
init in interface Evictable

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface Evictable
Throws:
java.lang.Exception

copy

public void copy(Evictable evictable)
          throws java.lang.Exception
Specified by:
copy in interface Evictable
Throws:
java.lang.Exception

mote

public void mote(Evictable recipient)
          throws java.lang.Exception
Specified by:
mote in interface Evictable
Throws:
java.lang.Exception

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface Evictable

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface Evictable

setLastAccessedTime

public void setLastAccessedTime(long lastAccessedTime)
Specified by:
setLastAccessedTime in interface Evictable

getMaxInactiveInterval

public int getMaxInactiveInterval()
Specified by:
getMaxInactiveInterval in interface Evictable

setMaxInactiveInterval

public void setMaxInactiveInterval(int maxInactiveInterval)
Specified by:
setMaxInactiveInterval in interface Evictable

getTimeToLive

public long getTimeToLive(long time)
Specified by:
getTimeToLive in interface Evictable

getTimedOut

public boolean getTimedOut(long time)
Specified by:
getTimedOut in interface Evictable

readExternal

public void readExternal(java.io.ObjectInput oi)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput oo)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

onDeserialization

protected void onDeserialization()

onSerialization

protected void onSerialization()


Copyright © 2008. All Rights Reserved.