|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.wanghy.cache.interceptor.caching.CachingAspectSupport org.wanghy.cache.interceptor.caching.CachingInterceptor
Caches the return value of the intercepted method.
Field Summary | |
private CacheProviderFacade |
cacheProviderFacade
Cache provider facade. |
private static Log |
logger
Message logger. |
Fields inherited from class org.wanghy.cache.interceptor.caching.CachingAspectSupport |
NULL_ENTRY |
Constructor Summary | |
CachingInterceptor()
Constructor. |
Method Summary | |
void |
afterPropertiesSet()
Event raised by the Spring container indicating that all the properties of this class has been set. |
protected Cached |
getCachingAttribute(MethodInvocation methodInvocation)
Returns the metadata attribute of the intercepted method. |
Object |
invoke(MethodInvocation methodInvocation)
Returns from the cache provider the value saved with the key generated using the specified MethodInvocation . |
void |
setCacheProviderFacade(CacheProviderFacade cacheProviderFacade)
Setter for the field . |
void |
setCachingAttributes(Properties cachingAttributes)
Set properties with method names as keys and caching-attribute descriptors (parsed via ) as values. |
Methods inherited from class org.wanghy.cache.interceptor.caching.CachingAspectSupport |
getCacheKeyGenerator, getCachingAttributeSource, getEntryStoredListener, setCacheKeyGenerator, setCachingAttributeSource, setEntryStoredListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Log logger
private CacheProviderFacade cacheProviderFacade
Constructor Detail |
public CachingInterceptor()
Method Detail |
public void afterPropertiesSet()
null
, this
method will create a new instance of
HashCodeCacheKeyGenerator
.
afterPropertiesSet
in interface InitializingBean
protected final Cached getCachingAttribute(MethodInvocation methodInvocation)
methodInvocation
- the description of an invocation to the method.
public final Object invoke(MethodInvocation methodInvocation) throws Throwable
MethodInvocation
. If the object is not
found in the cache, the intercepted method is executed and its returned
value is saved in the cached and returned by this method.
invoke
in interface MethodInterceptor
methodInvocation
- the description of the intercepted method.
Throwable
public final void setCacheProviderFacade(CacheProviderFacade cacheProviderFacade)
cacheProviderFacade
.
cacheProviderFacade
- the new value to setpublic final void setCachingAttributes(Properties cachingAttributes)
CachingAttributeEditor
) as values.
Note: Method names are always applied to the target class, no matter if defined in an interface or the class itself.
Internally, a
will
be created from the given properties.
NameMatchCachingAttributeSource
NameMatchCachingAttributeSource
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |