Package com.oracle.coherence.cdi
Class CacheGetInterceptor
- java.lang.Object
-
- com.oracle.coherence.cdi.AbstractCacheInterceptor
-
- com.oracle.coherence.cdi.CacheGetInterceptor
-
@Interceptor @Priority(1005) public class CacheGetInterceptor extends AbstractCacheInterceptor
A CDI interceptor that returns cached value if present; otherwise it returns and caches result of target method invocation.
-
-
Constructor Summary
Constructors Constructor Description CacheGetInterceptor(Coherence coherence, CoherenceExtension extension)
Create theCacheGetInterceptor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
cacheGet(javax.interceptor.InvocationContext ctxInvocation)
Returns cached value if available; otherwise invokes target method and stores invocation result in the cache before returning it.-
Methods inherited from class com.oracle.coherence.cdi.AbstractCacheInterceptor
getCoherence, getExtension, getSession
-
-
-
-
Constructor Detail
-
CacheGetInterceptor
@Inject public CacheGetInterceptor(@Name("") Coherence coherence, CoherenceExtension extension)
Create theCacheGetInterceptor
- Parameters:
coherence
- the Coherence instanceextension
- the Coherence CDI extension
-
-
Method Detail
-
cacheGet
public Object cacheGet(javax.interceptor.InvocationContext ctxInvocation) throws Exception
Returns cached value if available; otherwise invokes target method and stores invocation result in the cache before returning it.- Parameters:
ctxInvocation
- the invocation context- Returns:
- the cached value if available; otherwise returns the result of the invocation of the target method
- Throws:
Exception
- if thrown by target method
-
-