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, wait
getName
public 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 CacheableService
public void enableCache(boolean bEnable)
enableCache
in interface CacheableService
bEnable
- true to enable, false to disablepublic void resetCache()
resetCache
in interface CacheableService
public int getCacheSize()
getCacheSize
in interface CacheableService
public net.sf.ehcache.Cache getCache()
public List<String> getKeys()
getKeys
in interface CacheableService
public int getMaxElements()
getMaxElements
in interface CacheableService
public long getTimeToLive()
getTimeToLive
in interface CacheableService
public long getMemorySize()
getMemorySize
in interface CacheableService
public String getInfos()
getInfos
in interface CacheableService
public Object clone()
clone
in interface net.sf.ehcache.event.CacheEventListener
clone
in class Object
Object.clone()
public void notifyElementExpired(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element element)
notifyElementExpired
in interface net.sf.ehcache.event.CacheEventListener
public void notifyElementRemoved(net.sf.ehcache.Ehcache ehch, net.sf.ehcache.Element elmnt)
notifyElementRemoved
in interface net.sf.ehcache.event.CacheEventListener
public void notifyElementEvicted(net.sf.ehcache.Ehcache ehch, net.sf.ehcache.Element elmnt)
notifyElementEvicted
in interface net.sf.ehcache.event.CacheEventListener
public void notifyRemoveAll(net.sf.ehcache.Ehcache ehch)
notifyRemoveAll
in interface net.sf.ehcache.event.CacheEventListener
public void notifyElementPut(net.sf.ehcache.Ehcache ehch, net.sf.ehcache.Element elmnt)
notifyElementPut
in interface net.sf.ehcache.event.CacheEventListener
public void notifyElementUpdated(net.sf.ehcache.Ehcache ehch, net.sf.ehcache.Element elmnt)
notifyElementUpdated
in interface net.sf.ehcache.event.CacheEventListener
public void dispose()
dispose
in interface net.sf.ehcache.event.CacheEventListener
public void removeKey(String strKey)
strKey
- The key to removeCopyright © 2020 City of Paris. All rights reserved.