You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
webcrawler/web/src/main/java/web/aop/Advisor.java

28 lines
752 B

6 years ago
package web.aop;
7 years ago
import org.aopalliance.aop.Advice;
7 years ago
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
6 years ago
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
6 years ago
import org.springframework.util.ClassUtils;
6 years ago
import web.service.BaseService;
7 years ago
import java.lang.reflect.Method;
/**
* Created by reborn on 2017/8/3.
*/
@Component
public class Advisor extends StaticMethodMatcherPointcutAdvisor {
6 years ago
6 years ago
@Autowired
6 years ago
public Advisor(Advice advice) {
super(advice);
}
7 years ago
@Override
public boolean matches(Method method, Class<?> aClass) {
6 years ago
return BaseService.class.isAssignableFrom(ClassUtils.getUserClass(aClass))&&method.getName().equals("save");
7 years ago
}
}