public class EhCacheStore extends BaseStore implements net.sf.ehcache.event.CacheEventListener
Note: The current implementation always "removes" expired items.
storeListenersCLUSTERED, PERSISTENT, TRANSACTIONAL| Constructor and Description |
|---|
EhCacheStore(net.sf.ehcache.Cache cache,
IdGenerator idGenerator,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
void |
destroy() |
void |
dispose() |
net.sf.ehcache.Cache |
getCache() |
IdGenerator |
getIdGenerator() |
java.lang.String |
getName() |
boolean |
hasFeature(java.lang.String feature)
Returns true if feature is provided by the store (clustered), false else.
|
java.lang.Object |
load(java.lang.String id)
Loads an object that has been previously stored under the specified key.
|
void |
notifyElementEvicted(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element) |
void |
notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element) |
void |
notifyElementPut(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element) |
void |
notifyElementRemoved(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element) |
void |
notifyElementUpdated(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element) |
void |
notifyRemoveAll(net.sf.ehcache.Ehcache cache) |
java.lang.Object |
peek(java.lang.String id)
Loads an object that has been previously stored under the specified key.
|
void |
setCache(net.sf.ehcache.Cache cache) |
void |
setIdGenerator(IdGenerator idGenerator) |
void |
setName(java.lang.String name) |
java.lang.String |
store(java.lang.Object data)
Put an object into the store and return the unique id that may be used at
a later time to retrieve the object.
|
void |
store(java.lang.String id,
java.lang.Object data)
Put an object in the store under the given id.
|
addListener, fireAddedEvent, fireEvictedEvent, fireRemovedEvent, getStoreListeners, removeListenerpublic EhCacheStore(net.sf.ehcache.Cache cache,
IdGenerator idGenerator,
java.lang.String name)
public boolean hasFeature(java.lang.String feature)
Returns true if feature is provided by the store (clustered), false else.
hasFeature in interface Storefeature - the feature.public void destroy()
throws java.lang.Exception
java.lang.Exceptionpublic void store(java.lang.String id,
java.lang.Object data)
throws java.io.IOException
Put an object in the store under the given id. This method must be used with caution and the behavior is unspecified if an object already exist for the same id.
public java.lang.String store(java.lang.Object data)
throws java.io.IOException
Put an object into the store and return the unique id that may be used at a later time to retrieve the object.
public java.lang.Object load(java.lang.String id)
throws java.io.IOException
Loads an object that has been previously stored under the specified key. The object is removed from the store.
public java.lang.Object peek(java.lang.String id)
throws java.io.IOException
Loads an object that has been previously stored under the specified key. The object is not removed from the store.
public void notifyElementPut(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
throws net.sf.ehcache.CacheException
notifyElementPut in interface net.sf.ehcache.event.CacheEventListenernet.sf.ehcache.CacheExceptionpublic void notifyElementUpdated(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
throws net.sf.ehcache.CacheException
notifyElementUpdated in interface net.sf.ehcache.event.CacheEventListenernet.sf.ehcache.CacheExceptionpublic void notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
notifyElementExpired in interface net.sf.ehcache.event.CacheEventListenerpublic void notifyElementEvicted(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
notifyElementEvicted in interface net.sf.ehcache.event.CacheEventListenerpublic void notifyRemoveAll(net.sf.ehcache.Ehcache cache)
notifyRemoveAll in interface net.sf.ehcache.event.CacheEventListenerpublic void dispose()
dispose in interface net.sf.ehcache.event.CacheEventListenerpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface net.sf.ehcache.event.CacheEventListenerclone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic void notifyElementRemoved(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
throws net.sf.ehcache.CacheException
notifyElementRemoved in interface net.sf.ehcache.event.CacheEventListenernet.sf.ehcache.CacheExceptionpublic net.sf.ehcache.Cache getCache()
public void setCache(net.sf.ehcache.Cache cache)
public IdGenerator getIdGenerator()
public void setIdGenerator(IdGenerator idGenerator)
public java.lang.String getName()
public void setName(java.lang.String name)
Copyright © 2005-2014 FuseSource. All Rights Reserved.