com.livis.livingtalks.ejb
Interface DataHandler
- All Known Implementing Classes:
- WriteThroughCache, CachingEntityHandler
- public interface DataHandler
Method Summary |
java.lang.Object |
read(java.lang.String key)
Read data stored at key. |
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. |
writeNew
public java.lang.String writeNew(java.lang.String key,
java.lang.Object data)
throws javax.ejb.CreateException
- Write new data.
- 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
- Updates old data.
- 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)
- Read data stored at key.
- 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