Package dev.voidframework.cache.module
Class CacheInterceptor
java.lang.Object
dev.voidframework.cache.module.CacheInterceptor
- All Implemented Interfaces:
org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor
- Direct Known Subclasses:
CacheInterceptorRemove,CacheInterceptorResult
public abstract class CacheInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor
Intercepts method calls to apply the desired cache behavior.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringresolveCacheKey(org.aopalliance.intercept.MethodInvocation methodInvocation, String keyPattern) Resolves the cache key.voidsetCacheEngine(CacheEngine cacheEngine) Sets the cache engine to use.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aopalliance.intercept.MethodInterceptor
invoke
-
Field Details
-
cacheEngine
-
-
Constructor Details
-
CacheInterceptor
public CacheInterceptor()Build a new instance.
-
-
Method Details
-
setCacheEngine
Sets the cache engine to use.- Parameters:
cacheEngine- The cache engine
-
resolveCacheKey
protected String resolveCacheKey(org.aopalliance.intercept.MethodInvocation methodInvocation, String keyPattern) Resolves the cache key.- Parameters:
methodInvocation- The current method invocationkeyPattern- The key pattern- Returns:
- The resolved cache key
-