本文整理汇总了Java中org.springframework.aop.support.StaticMethodMatcherPointcut类的典型用法代码示例。如果您正苦于以下问题:Java StaticMethodMatcherPointcut类的具体用法?Java StaticMethodMatcherPointcut怎么用?Java StaticMethodMatcherPointcut使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StaticMethodMatcherPointcut类属于org.springframework.aop.support包,在下文中一共展示了StaticMethodMatcherPointcut类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: advisor
import org.springframework.aop.support.StaticMethodMatcherPointcut; //导入依赖的package包/类
/**
*
*
* @return .
*/
@Bean
public Advisor advisor(final ContextService contextService) {
return new AbstractPointcutAdvisor() {
private static final long serialVersionUID = -192186951500259942L;
@Override
public Advice getAdvice() {
return advice(contextService);
}
@Override
public Pointcut getPointcut() {
return new StaticMethodMatcherPointcut() {
@Override
public boolean matches(Method method, Class<?> clazz) {
return method.getAnnotation(Conversation.class) != null;
}
};
}
};
}
示例2: advisor
import org.springframework.aop.support.StaticMethodMatcherPointcut; //导入依赖的package包/类
public static Advisor advisor() {
return new DefaultPointcutAdvisor(
new StaticMethodMatcherPointcut() {
@Override
public boolean matches(Method method, Class<?> targetClass) {
return method.getParameterTypes().length == 1 &&
method.getParameterTypes()[0].equals(Integer.class);
}
},
new TraceAfterReturningAdvice());
}
示例3: getControllerPointcut
import org.springframework.aop.support.StaticMethodMatcherPointcut; //导入依赖的package包/类
private static StaticMethodMatcherPointcut getControllerPointcut() {
return new StaticMethodMatcherPointcut() {
@Override
public boolean matches(Method method, Class<?> targetClass) {
return ((AnnotationUtils.findAnnotation(targetClass, Controller.class) != null) ||
(AnnotationUtils.findAnnotation(targetClass, RequestMapping.class) != null));
}
};
}