Package org.infinispan.jcache.annotation
Class AbstractCacheResultInterceptor
java.lang.Object
org.infinispan.jcache.annotation.AbstractCacheResultInterceptor
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CacheResultInterceptor,InjectedCacheResultInterceptor
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
ConstructorsConstructorDescriptionAbstractCacheResultInterceptor(javax.cache.annotation.CacheResolver defaultCacheResolver, CacheKeyInvocationContextFactory contextFactory) -
Method Summary
Modifier and TypeMethodDescriptioncacheResult(javax.interceptor.InvocationContext invocationContext) protected abstract org.infinispan.jcache.logging.LoggetLog()
-
Constructor Details
-
AbstractCacheResultInterceptor
public AbstractCacheResultInterceptor(javax.cache.annotation.CacheResolver defaultCacheResolver, CacheKeyInvocationContextFactory contextFactory)
-
-
Method Details
-
cacheResult
- Throws:
Throwable
-
getLog
protected abstract org.infinispan.jcache.logging.Log getLog()
-