|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springmodules.cache.provider.AbstractCacheProviderFacade
org.jasig.portal.utils.cache.EhCacheFacade
public class EhCacheFacade
Similar to the spring-modules EhCacheFacade except this
will create a cache if it does not already exist.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
|
| Constructor Summary | |
|---|---|
EhCacheFacade()
|
|
| Method Summary | |
|---|---|
protected net.sf.ehcache.Cache |
getCache(org.springmodules.cache.CachingModel model)
Returns a EHCache cache from the cache manager. |
protected net.sf.ehcache.Cache |
getCache(String name)
Returns a EHCache cache from the cache manager. |
net.sf.ehcache.CacheManager |
getCacheManager()
|
PropertyEditor |
getCachingModelEditor()
|
PropertyEditor |
getFlushingModelEditor()
|
boolean |
isCreateMissingCaches()
|
protected boolean |
isSerializableCacheElementRequired()
|
org.springmodules.cache.provider.CacheModelValidator |
modelValidator()
Returns the validator of cache models. |
protected void |
onFlushCache(org.springmodules.cache.FlushingModel model)
Removes all the entries in the caches specified in the given flushing model. |
protected Object |
onGetFromCache(Serializable key,
org.springmodules.cache.CachingModel model)
Retrieves an object stored under the given key from the cache specified in the given caching model. |
protected void |
onPutInCache(Serializable key,
org.springmodules.cache.CachingModel model,
Object obj)
Stores the given object under the given key in the cache specified in the given caching model. |
protected void |
onRemoveFromCache(Serializable key,
org.springmodules.cache.CachingModel model)
Removes the object stored under the given key from the cache specified in the given caching model. |
void |
setCacheManager(net.sf.ehcache.CacheManager newCacheManager)
Sets the EHCache cache manager to use. |
void |
setCreateMissingCaches(boolean createMissingCaches)
|
protected void |
validateCacheManager()
|
| Methods inherited from class org.springmodules.cache.provider.AbstractCacheProviderFacade |
|---|
afterPropertiesSet, assertCacheManagerIsNotNull, cancelCacheUpdate, flushCache, getFromCache, handleCatchedException, isFailQuietlyEnabled, makeSerializableIfNecessary, onAfterPropertiesSet, onCancelCacheUpdate, putInCache, removeFromCache, setFailQuietlyEnabled, setSerializableFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public EhCacheFacade()
| Method Detail |
|---|
public boolean isCreateMissingCaches()
public void setCreateMissingCaches(boolean createMissingCaches)
createMissingCaches - the createMissingCaches to setpublic net.sf.ehcache.CacheManager getCacheManager()
public void setCacheManager(net.sf.ehcache.CacheManager newCacheManager)
newCacheManager - the new cache managerpublic org.springmodules.cache.provider.CacheModelValidator modelValidator()
EhCacheModelValidator.
public PropertyEditor getCachingModelEditor()
CacheProviderFacade.getCachingModelEditor()public PropertyEditor getFlushingModelEditor()
CacheProviderFacade.getFlushingModelEditor()
protected net.sf.ehcache.Cache getCache(org.springmodules.cache.CachingModel model)
throws org.springmodules.cache.provider.CacheNotFoundException,
org.springmodules.cache.provider.CacheAccessException
model - the model containing the name of the cache to retrieve
org.springmodules.cache.provider.CacheNotFoundException - if the cache does not exist
org.springmodules.cache.provider.CacheAccessException - wrapping any unexpected exception thrown by the cache
protected net.sf.ehcache.Cache getCache(String name)
throws org.springmodules.cache.provider.CacheNotFoundException,
org.springmodules.cache.provider.CacheAccessException
name - the name of the cache
org.springmodules.cache.provider.CacheNotFoundException - if the cache does not exist
org.springmodules.cache.provider.CacheAccessException - wrapping any unexpected exception thrown by the cacheprotected boolean isSerializableCacheElementRequired()
isSerializableCacheElementRequired in class org.springmodules.cache.provider.AbstractCacheProviderFacadetrue. EHCache can only store Serializable objectsAbstractCacheProviderFacade.isSerializableCacheElementRequired()
protected void onFlushCache(org.springmodules.cache.FlushingModel model)
throws org.springmodules.cache.CacheException
EhCacheFlushingModel.
onFlushCache in class org.springmodules.cache.provider.AbstractCacheProviderFacademodel - the flushing model.
org.springmodules.cache.provider.CacheNotFoundException - if the cache specified in the given model cannot be found.
org.springmodules.cache.provider.CacheAccessException - wrapping any unexpected exception thrown by the cache.
org.springmodules.cache.CacheExceptionAbstractCacheProviderFacade.onFlushCache(FlushingModel)
protected Object onGetFromCache(Serializable key,
org.springmodules.cache.CachingModel model)
throws org.springmodules.cache.CacheException
EhCacheCachingModel.
onGetFromCache in class org.springmodules.cache.provider.AbstractCacheProviderFacadekey - the key of the cache entrymodel - the caching model
null.
org.springmodules.cache.provider.CacheNotFoundException - if the cache specified in the given model cannot be found.
org.springmodules.cache.provider.CacheAccessException - wrapping any unexpected exception thrown by the cache.
org.springmodules.cache.CacheExceptionAbstractCacheProviderFacade.onGetFromCache(Serializable, CachingModel)
protected void onPutInCache(Serializable key,
org.springmodules.cache.CachingModel model,
Object obj)
throws org.springmodules.cache.CacheException
EhCacheCachingModel.
onPutInCache in class org.springmodules.cache.provider.AbstractCacheProviderFacadekey - the key of the cache entrymodel - the caching modelobj - the object to store in the cache
ObjectCannotBeCachedException - if the object to store is not an implementation of
java.io.Serializable.
org.springmodules.cache.provider.CacheNotFoundException - if the cache specified in the given model cannot be found.
org.springmodules.cache.provider.CacheAccessException - wrapping any unexpected exception thrown by the cache.
org.springmodules.cache.CacheExceptionAbstractCacheProviderFacade.onPutInCache(Serializable, CachingModel,
Object)
protected void onRemoveFromCache(Serializable key,
org.springmodules.cache.CachingModel model)
throws org.springmodules.cache.CacheException
EhCacheCachingModel.
onRemoveFromCache in class org.springmodules.cache.provider.AbstractCacheProviderFacadekey - the key of the cache entrymodel - the caching model
org.springmodules.cache.provider.CacheNotFoundException - if the cache specified in the given model cannot be found.
org.springmodules.cache.provider.CacheAccessException - wrapping any unexpected exception thrown by the cache.
org.springmodules.cache.CacheExceptionAbstractCacheProviderFacade.onRemoveFromCache(Serializable,
CachingModel)
protected void validateCacheManager()
throws org.springmodules.cache.FatalCacheException
validateCacheManager in class org.springmodules.cache.provider.AbstractCacheProviderFacadeorg.springmodules.cache.FatalCacheException - if the cache manager is null.AbstractCacheProviderFacade.validateCacheManager()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||