|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PersistenceListener
Defines the methods that are required to persist cache data.
To provide a custom persistence mechanism you should implement this
interface and supply the fully-qualified classname to the cache via
the cache.persistence.class
configuration property.
Method Summary | |
---|---|
void |
clear()
Clear the entire persistent cache (including the root) |
PersistenceListener |
configure(Config config)
Allow the persistence code to initialize itself based on the supplied cache configuration. |
boolean |
isGroupStored(String groupName)
Verify if a group is currently stored in the persistent cache. |
boolean |
isStored(String key)
Verify if an object is currently stored in the persistent cache. |
void |
remove(String key)
Removes an object from the persistent cache |
void |
removeGroup(String groupName)
Removes a group from the persistent cache. |
Object |
retrieve(String key)
Retrieves an object from the persistent cache. |
Set |
retrieveGroup(String groupName)
Retrieves a group from the persistent cache. |
void |
store(String key,
Object obj)
Stores an object in the persistent cache. |
void |
storeGroup(String groupName,
Set group)
Stores a group in the persistent cache. |
Method Detail |
---|
boolean isStored(String key) throws CachePersistenceException
key
- The cache key of the object to check.
CachePersistenceException
boolean isGroupStored(String groupName) throws CachePersistenceException
groupName
- The name of the group to check.
CachePersistenceException
void clear() throws CachePersistenceException
CachePersistenceException
PersistenceListener configure(Config config)
void remove(String key) throws CachePersistenceException
CachePersistenceException
void removeGroup(String groupName) throws CachePersistenceException
groupName
- The name of the cache group to remove.
CachePersistenceException
Object retrieve(String key) throws CachePersistenceException
key
- The unique cache key that maps to the object
being retrieved.
null
if no object was found
matching the supplied key.
CachePersistenceException
void store(String key, Object obj) throws CachePersistenceException
key
- The key to uniquely identify this object.obj
- The object to persist. Most implementations
of this interface will require this object implements
Serializable
.
CachePersistenceException
void storeGroup(String groupName, Set group) throws CachePersistenceException
groupName
- The name of the group to persist.group
- A set containing the keys of all the CacheEntry
objects that belong to this group.
CachePersistenceException
Set retrieveGroup(String groupName) throws CachePersistenceException
groupName
- The name of the group to retrieve.
CacheEntry
objects that belong
to this group.
CachePersistenceException
|
OSCache Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |