com.livis.livingtalks.ejb
Class CachingEntityHandler

java.lang.Object
  |
  +--com.livis.livingtalks.ejb.EntityHandler
        |
        +--com.livis.livingtalks.ejb.CachingEntityHandler
Direct Known Subclasses:
CachingAuthorHandler, CachingAuthorshipHandler, CachingBlockHandler, CachingPitemHandler, CachingTalkHandler, CachingTrackHandler, CachingTypeHandler

public abstract class CachingEntityHandler
extends EntityHandler
implements DataHandler


Fields inherited from class com.livis.livingtalks.ejb.EntityHandler
creatorModel, finder1, finder1a, finder2, finderAll, finderByPrimaryKey, getterModel, setterModel
 
Constructor Summary
protected CachingEntityHandler(java.lang.String homeName, java.lang.Class homeClass)
           
 
Method Summary
 java.lang.String create(AbstractModel model)
           
 java.util.Collection getKeysAll()
           
 AbstractModel getShortmodel(java.lang.String key)
           
 java.util.Collection getShortmodelsAll()
           
 void invalidateCache()
           
 java.lang.Object read(java.lang.String key)
          Read data stored at key.
 void remove(java.lang.String key)
           
 void setModel(AbstractModel model)
           
protected abstract  WriteThroughCache sharedCache()
           
 java.lang.String writeNew(java.lang.String key, java.lang.Object data)
          Write new data.
 void writeOld(java.lang.String key, java.lang.Object data)
          Updates old data.
 
Methods inherited from class com.livis.livingtalks.ejb.EntityHandler
getKeys1, getKeys1a, getKeys2, getModel
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingEntityHandler

protected CachingEntityHandler(java.lang.String homeName,
                               java.lang.Class homeClass)
Method Detail

sharedCache

protected abstract WriteThroughCache sharedCache()

invalidateCache

public void invalidateCache()

getShortmodel

public AbstractModel getShortmodel(java.lang.String key)
Overrides:
getShortmodel in class EntityHandler

setModel

public void setModel(AbstractModel model)
              throws javax.ejb.CreateException
Overrides:
setModel in class EntityHandler

remove

public void remove(java.lang.String key)
            throws com.livis.livingtalks.ejb.RemoveException
Overrides:
remove in class EntityHandler

create

public java.lang.String create(AbstractModel model)
                        throws javax.ejb.CreateException
Overrides:
create in class EntityHandler

getShortmodelsAll

public java.util.Collection getShortmodelsAll()
Overrides:
getShortmodelsAll in class EntityHandler

getKeysAll

public java.util.Collection getKeysAll()
Overrides:
getKeysAll in class EntityHandler

writeNew

public java.lang.String writeNew(java.lang.String key,
                                 java.lang.Object data)
                          throws javax.ejb.CreateException
Description copied from interface: DataHandler
Write new data.
Specified by:
writeNew in interface DataHandler
Tags copied from interface: DataHandler
Parameters:
data - The data to be stored. data must not be null.
key - The key under which the data should be stored. key may be null.
Returns:
the key under which the data finally got stored.
Throws:
CreateException - if key does already exist and no other key was used.

writeOld

public void writeOld(java.lang.String key,
                     java.lang.Object data)
              throws javax.ejb.CreateException
Description copied from interface: DataHandler
Updates old data.
Specified by:
writeOld in interface DataHandler
Tags copied from interface: DataHandler
Parameters:
data - the data to be stored. A value of null will delete the data.
key - The key under which to store the data. key must not be null.
Throws:
CreateException - if key does not exist

read

public java.lang.Object read(java.lang.String key)
Description copied from interface: DataHandler
Read data stored at key.
Specified by:
read in interface DataHandler
Tags copied from interface: DataHandler
Parameters:
key - The key to retrieve the data for. A value of null will return null.
Returns:
The object previously stored, or null if no such data exists.
Throws:
CreateException - if key does not exist