org.codehaus.wadi.impl
Class DiscMotable

java.lang.Object
  extended byorg.codehaus.wadi.impl.SimpleEvictable
      extended byorg.codehaus.wadi.impl.AbstractMotable
          extended byorg.codehaus.wadi.impl.DiscMotable
All Implemented Interfaces:
Evictable, Motable, Serializable, StoreMotable

public class DiscMotable
extends AbstractMotable
implements StoreMotable

See Also:
Serialized Form

Field Summary
protected  int _bodyLength
           
protected  DiscMotableConfig _config
           
protected  File _file
           
protected static Log _log
           
protected  long _offset
           
 
Fields inherited from class org.codehaus.wadi.impl.AbstractMotable
_name
 
Fields inherited from class org.codehaus.wadi.impl.SimpleEvictable
_creationTime, _lastAccessedTime, _maxInactiveInterval
 
Constructor Summary
DiscMotable()
           
 
Method Summary
 void destroy()
           
 void destroy(Motable recipient)
           
protected  void ensureFile()
           
 byte[] getBodyAsByteArray()
           
 ByteBuffer getBodyAsByteBuffer()
           
 void init(StoreMotableConfig config)
           
 void init(StoreMotableConfig config, String name)
           
 Object loadBody(boolean useNIO)
           
protected  long loadHeader()
           
 void setBodyAsByteArray(byte[] body)
           
 void setBodyAsByteBuffer(ByteBuffer body)
           
protected  void store(boolean useNIO, Object body)
           
 
Methods inherited from class org.codehaus.wadi.impl.AbstractMotable
copy, getName, init, mote, readContent, writeContent
 
Methods inherited from class org.codehaus.wadi.impl.SimpleEvictable
checkTimeframe, copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, isNew, mote, setLastAccessedTime, setMaxInactiveInterval
 
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.Motable
copy, getName, init, mote
 
Methods inherited from interface org.codehaus.wadi.Evictable
checkTimeframe, copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, isNew, mote, setLastAccessedTime, setMaxInactiveInterval
 

Field Detail

_log

protected static final Log _log

_config

protected DiscMotableConfig _config

_file

protected File _file

_bodyLength

protected int _bodyLength

_offset

protected long _offset
Constructor Detail

DiscMotable

public DiscMotable()
Method Detail

init

public void init(StoreMotableConfig config)
Specified by:
init in interface StoreMotable

init

public void init(StoreMotableConfig config,
                 String name)
          throws Exception
Specified by:
init in interface StoreMotable
Throws:
Exception

getBodyAsByteArray

public byte[] getBodyAsByteArray()
                          throws Exception
Specified by:
getBodyAsByteArray in interface Motable
Throws:
Exception

setBodyAsByteArray

public void setBodyAsByteArray(byte[] body)
                        throws Exception
Specified by:
setBodyAsByteArray in interface Motable
Throws:
Exception

getBodyAsByteBuffer

public ByteBuffer getBodyAsByteBuffer()
                               throws Exception
Specified by:
getBodyAsByteBuffer in interface Motable
Throws:
Exception

setBodyAsByteBuffer

public void setBodyAsByteBuffer(ByteBuffer body)
                         throws Exception
Specified by:
setBodyAsByteBuffer in interface Motable
Throws:
Exception

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface Evictable
Overrides:
destroy in class AbstractMotable
Throws:
Exception

destroy

public void destroy(Motable recipient)
             throws Exception
Throws:
Exception

ensureFile

protected void ensureFile()

loadHeader

protected long loadHeader()

loadBody

public Object loadBody(boolean useNIO)
                throws Exception
Throws:
Exception

store

protected void store(boolean useNIO,
                     Object body)
              throws Exception
Throws:
Exception


Copyright © 2004-2008 Core Developers Network Ltd.. All Rights Reserved.