Package org.infinispan.jcache.annotation
Class CacheResultInterceptor
- java.lang.Object
-
- org.infinispan.jcache.annotation.AbstractCacheResultInterceptor
-
- org.infinispan.jcache.annotation.CacheResultInterceptor
-
- All Implemented Interfaces:
Serializable
@Interceptor public class CacheResultInterceptor extends AbstractCacheResultInterceptor
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
(C) 2011 SERLI, Galder ZamarreƱo - See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.infinispan.jcache.annotation.AbstractCacheResultInterceptor
trace
-
-
Constructor Summary
Constructors Constructor Description CacheResultInterceptor(DefaultCacheResolver cacheResolver, CacheKeyInvocationContextFactory contextFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
cacheResult(javax.interceptor.InvocationContext invocationContext)
protected org.infinispan.jcache.logging.Log
getLog()
-
-
-
Constructor Detail
-
CacheResultInterceptor
@Inject public CacheResultInterceptor(DefaultCacheResolver cacheResolver, CacheKeyInvocationContextFactory contextFactory)
-
-
Method Detail
-
cacheResult
public Object cacheResult(javax.interceptor.InvocationContext invocationContext) throws Exception
- Overrides:
cacheResult
in classAbstractCacheResultInterceptor
- Throws:
Exception
-
getLog
protected org.infinispan.jcache.logging.Log getLog()
- Specified by:
getLog
in classAbstractCacheResultInterceptor
-
-