org.codehaus.wadi.impl
Class DatabaseMotable

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

public class DatabaseMotable
extends AbstractMotable
implements StoreMotable

A Motable that represents its Bytes field as a row in a Shared DataBase table.

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

Field Summary
protected  DatabaseMotableConfig _config
           
protected  Connection _connection
           
protected static Log _log
           
 
Fields inherited from class org.codehaus.wadi.impl.AbstractMotable
_name
 
Fields inherited from class org.codehaus.wadi.impl.SimpleEvictable
_creationTime, _lastAccessedTime, _maxInactiveInterval
 
Constructor Summary
DatabaseMotable()
           
 
Method Summary
 void copy(Motable motable)
           
 void destroy()
           
 void destroy(Motable recipient)
           
 byte[] getBodyAsByteArray()
           
 ByteBuffer getBodyAsByteBuffer()
           
 Connection getConnection()
           
 void init(StoreMotableConfig config)
           
 void init(StoreMotableConfig config, String name)
           
 void mote(Motable recipient)
           
 void setBodyAsByteArray(byte[] body)
           
 void setBodyAsByteBuffer(ByteBuffer body)
           
 void setConnection(Connection connection)
           
protected  void store(Object body)
           
 
Methods inherited from class org.codehaus.wadi.impl.AbstractMotable
getName, init, 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
getName, init
 
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 DatabaseMotableConfig _config

_connection

protected Connection _connection
Constructor Detail

DatabaseMotable

public DatabaseMotable()
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

getConnection

public Connection getConnection()

setConnection

public void setConnection(Connection connection)

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

copy

public void copy(Motable motable)
          throws Exception
Specified by:
copy in interface Motable
Overrides:
copy in class AbstractMotable
Throws:
Exception

mote

public void mote(Motable recipient)
          throws Exception
Specified by:
mote in interface Motable
Overrides:
mote in class AbstractMotable
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

store

protected void store(Object body)
              throws Exception
Throws:
Exception


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