public abstract class AbstractCacheableService extends Object implements CacheableService, net.sf.ehcache.event.CacheEventListener
| Constructor and Description |
|---|
AbstractCacheableService() |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
void |
dispose() |
void |
enableCache(boolean bEnable)
Enable the cache
|
net.sf.ehcache.Cache |
getCache()
Return a cache object
|
int |
getCacheSize()
Gets the number of item currently in the cache.
|
Object |
getFromCache(String strKey)
Gets an object from the cache
|
String |
getInfos()
Returns cache infos
|
List<String> |
getKeys()
Gets all keys in the cache
|
int |
getMaxElements()
Returns maximum elements accepted into the cache
|
long |
getMemorySize()
Return the memory size
|
long |
getTimeToLive()
Returns the time to live for objects in the cache
|
void |
initCache()
Init the cache.
|
void |
initCache(String strCacheName)
Init the cache.
|
boolean |
isCacheEnable()
Gets the current cache status.
|
void |
notifyElementEvicted(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt) |
void |
notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element) |
void |
notifyElementPut(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt) |
void |
notifyElementRemoved(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt) |
void |
notifyElementUpdated(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt) |
void |
notifyRemoveAll(net.sf.ehcache.Ehcache ehch) |
void |
putInCache(String strKey,
Object object)
Put an object into the cache
|
void |
removeKey(String strKey)
Remove a key from the cache
|
void |
resetCache()
Reset the cache.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamepublic void initCache()
public void initCache(String strCacheName)
strCacheName - The cache namepublic void putInCache(String strKey, Object object)
strKey - The key of the object to put into the cacheobject - The object to put into the cachepublic Object getFromCache(String strKey)
strKey - The key of the object to retrieve from the cachepublic boolean isCacheEnable()
isCacheEnable in interface CacheableServicepublic void enableCache(boolean bEnable)
enableCache in interface CacheableServicebEnable - true to enable, false to disablepublic void resetCache()
resetCache in interface CacheableServicepublic int getCacheSize()
getCacheSize in interface CacheableServicepublic net.sf.ehcache.Cache getCache()
public List<String> getKeys()
getKeys in interface CacheableServicepublic int getMaxElements()
getMaxElements in interface CacheableServicepublic long getTimeToLive()
getTimeToLive in interface CacheableServicepublic long getMemorySize()
getMemorySize in interface CacheableServicepublic String getInfos()
getInfos in interface CacheableServicepublic Object clone()
clone in interface net.sf.ehcache.event.CacheEventListenerclone in class ObjectObject.clone()public void notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element element)
notifyElementExpired in interface net.sf.ehcache.event.CacheEventListenerpublic void notifyElementRemoved(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt)
notifyElementRemoved in interface net.sf.ehcache.event.CacheEventListenerpublic void notifyElementEvicted(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt)
notifyElementEvicted in interface net.sf.ehcache.event.CacheEventListenerpublic void notifyRemoveAll(net.sf.ehcache.Ehcache ehch)
notifyRemoveAll in interface net.sf.ehcache.event.CacheEventListenerpublic void notifyElementPut(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt)
notifyElementPut in interface net.sf.ehcache.event.CacheEventListenerpublic void notifyElementUpdated(net.sf.ehcache.Ehcache ehch,
net.sf.ehcache.Element elmnt)
notifyElementUpdated in interface net.sf.ehcache.event.CacheEventListenerpublic void dispose()
dispose in interface net.sf.ehcache.event.CacheEventListenerpublic void removeKey(String strKey)
strKey - The key to removeCopyright © 2020 City of Paris. All rights reserved.