Package org.infinispan.jcache.annotation
Class AbstractCacheResultInterceptor
- java.lang.Object
-
- org.infinispan.jcache.annotation.AbstractCacheResultInterceptor
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CacheResultInterceptor
,InjectedCacheResultInterceptor
public abstract class AbstractCacheResultInterceptor extends Object implements 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
(C) 2011 SERLI, Galder ZamarreƱo - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
trace
-
Constructor Summary
Constructors Constructor Description AbstractCacheResultInterceptor(javax.cache.annotation.CacheResolver cacheResolver, CacheKeyInvocationContextFactory contextFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
cacheResult(javax.interceptor.InvocationContext invocationContext)
protected abstract org.infinispan.jcache.logging.Log
getLog()
-
-
-
Constructor Detail
-
AbstractCacheResultInterceptor
public AbstractCacheResultInterceptor(javax.cache.annotation.CacheResolver cacheResolver, CacheKeyInvocationContextFactory contextFactory)
-
-