Spring 中的Advisors API
在 Spring 中,Advisor 是一个方面,它仅包含与关联的通知对象与切入点表达式。
除了介绍的特殊情况外,任何顾问都可以获得任何建议。org.springframework.aop.support.DefaultPointcutAdvisor
是最常用的advisor 类。它可以与MethodInterceptor
,BeforeAdvice
或ThrowsAdvice
.
可以在 Spring 中在同一个 AOP 代理中混合使用 advisor 和 advise 类型。 为 例如,您可以在一个代理配置中使用 advice、throws advice 和before advice 的拦截。Spring 自动创建必要的拦截器 链。