com.jarvis.cache.autoconfigure.MethodAnnotationPointcutAdvisor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoload-cache-spring-boot-starter Show documentation
Show all versions of autoload-cache-spring-boot-starter Show documentation
autoload-cache spring boot starter.
The newest version!
package com.jarvis.cache.autoconfigure;
import java.lang.annotation.Annotation;
import org.aopalliance.aop.Advice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
/**
* PointcutAdvisor
*
*
*/
public class MethodAnnotationPointcutAdvisor extends AbstractPointcutAdvisor {
private static final long serialVersionUID = -7431399745989513294L;
private final Pointcut pointcut;
private final Advice advice;
public MethodAnnotationPointcutAdvisor(Class extends Annotation> methodAnnotationType, Advice advice) {
this.pointcut = new AnnotationMatchingPointcut(null, methodAnnotationType);
this.advice = advice;
}
@Override
public Pointcut getPointcut() {
return this.pointcut;
}
@Override
public Advice getAdvice() {
return this.advice;
}
}