
com.github.bingoohuang.springrediscache.RedisCacheEnabledAdvisor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-redis-cache Show documentation
Show all versions of spring-redis-cache Show documentation
spring cache based on redis
The newest version!
package com.github.bingoohuang.springrediscache;
import org.aopalliance.aop.Advice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
@Component
public class RedisCacheEnabledAdvisor extends AbstractPointcutAdvisor {
final StaticMethodMatcherPointcut pointcut = new StaticMethodMatcherPointcut() {
@Override
public boolean matches(Method method, Class> targetClass) {
return method.isAnnotationPresent(RedisCacheEnabled.class);
}
};
@Autowired
RedisCacheEnabledInterceptor interceptor;
@Override
public Pointcut getPointcut() {
return this.pointcut;
}
@Override
public Advice getAdvice() {
return this.interceptor;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy