Package org.infinispan.jcache.annotation
Class CacheResultInterceptor
java.lang.Object
org.infinispan.jcache.annotation.AbstractCacheResultInterceptor
org.infinispan.jcache.annotation.CacheResultInterceptor
- All Implemented Interfaces:
Serializable
CacheResult interceptor implementation. This interceptor uses the following algorithm describes in
JSR-107.
When a method annotated with CacheResult is invoked the following must occur.
- Generate a key based on InvocationContext using the specified CacheKeyGenerator.
- Use this key to look up the entry in the cache.
- If an entry is found return it as the result and do not call the annotated method.
- If no entry is found invoke the method.
- Use the result to populate the cache with this key/result pair.
- Author:
- Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI, Galder ZamarreƱo
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCacheResultInterceptor(DefaultCacheResolver cacheResolver, CacheKeyInvocationContextFactory contextFactory) -
Method Summary
Modifier and TypeMethodDescriptioncacheResult(javax.interceptor.InvocationContext invocationContext) protected org.infinispan.jcache.logging.LoggetLog()
-
Constructor Details
-
CacheResultInterceptor
@Inject public CacheResultInterceptor(DefaultCacheResolver cacheResolver, CacheKeyInvocationContextFactory contextFactory)
-
-
Method Details
-
cacheResult
- Overrides:
cacheResultin classAbstractCacheResultInterceptor- Throws:
Throwable
-
getLog
protected org.infinispan.jcache.logging.Log getLog()- Specified by:
getLogin classAbstractCacheResultInterceptor
-