org.codehaus.wadi.core.motable
Class AbstractMotable

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

public abstract class AbstractMotable
extends SimpleEvictable
implements Motable

Implement all of Motable except for the Bytes field. This is the field most likely to have different representations.

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

Field Summary
protected  java.util.concurrent.locks.ReadWriteLock readWriteLock
           
 
Fields inherited from class org.codehaus.wadi.core.eviction.SimpleEvictable
memento
 
Constructor Summary
protected AbstractMotable()
           
 
Method Summary
 void copy(Motable motable)
           
 void destroy()
           
protected  void destroyForMotion()
           
 AbstractMotableMemento getAbstractMotableMemento()
           
 java.lang.String getName()
           
 java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
           
 void init(long creationTime, long lastAccessedTime, int maxInactiveInterval, java.lang.String name)
           
protected  void initExisting(long creationTime, long lastAccessedTime, int maxInactiveInterval, java.lang.String name, byte[] body)
           
 boolean isNew()
           
 void mote(Motable recipient)
           
protected  SimpleEvictableMemento newMemento()
           
protected  java.util.concurrent.locks.ReadWriteLock newReadWriteLock()
           
protected  void onDeserialization()
           
 void rehydrate(long creationTime, long lastAccessedTime, int maxInactiveInterval, java.lang.String name, byte[] body)
           
 void restore(long creationTime, long lastAccessedTime, int maxInactiveInterval, java.lang.String name, byte[] body)
           
 
Methods inherited from class org.codehaus.wadi.core.eviction.SimpleEvictable
copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, mote, onSerialization, readExternal, setLastAccessedTime, setMaxInactiveInterval, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.wadi.core.motable.Motable
getBodyAsByteArray, setBodyAsByteArray
 
Methods inherited from interface org.codehaus.wadi.core.eviction.Evictable
copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, mote, setLastAccessedTime, setMaxInactiveInterval
 

Field Detail

readWriteLock

protected java.util.concurrent.locks.ReadWriteLock readWriteLock
Constructor Detail

AbstractMotable

protected AbstractMotable()
Method Detail

newMemento

protected SimpleEvictableMemento newMemento()
Overrides:
newMemento in class SimpleEvictable

getAbstractMotableMemento

public AbstractMotableMemento getAbstractMotableMemento()

getReadWriteLock

public java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
Specified by:
getReadWriteLock in interface Motable

init

public void init(long creationTime,
                 long lastAccessedTime,
                 int maxInactiveInterval,
                 java.lang.String name)
Specified by:
init in interface Motable

rehydrate

public void rehydrate(long creationTime,
                      long lastAccessedTime,
                      int maxInactiveInterval,
                      java.lang.String name,
                      byte[] body)
               throws RehydrationException
Specified by:
rehydrate in interface Motable
Throws:
RehydrationException

restore

public void restore(long creationTime,
                    long lastAccessedTime,
                    int maxInactiveInterval,
                    java.lang.String name,
                    byte[] body)
             throws RehydrationException
Specified by:
restore in interface Motable
Throws:
RehydrationException

copy

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

mote

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

getName

public java.lang.String getName()
Specified by:
getName in interface Motable

isNew

public boolean isNew()
Specified by:
isNew in interface Motable

destroy

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

onDeserialization

protected void onDeserialization()
Overrides:
onDeserialization in class SimpleEvictable

newReadWriteLock

protected java.util.concurrent.locks.ReadWriteLock newReadWriteLock()

initExisting

protected void initExisting(long creationTime,
                            long lastAccessedTime,
                            int maxInactiveInterval,
                            java.lang.String name,
                            byte[] body)
                     throws RehydrationException
Throws:
RehydrationException

destroyForMotion

protected void destroyForMotion()
                         throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2011. All Rights Reserved.