Defining New Advice Types
Spring AOP 被设计为可扩展的。虽然目前在内部使用拦截实现策略,但除了拦截建议周围、之前、抛出建议和返回建议之后的建议类型之外,还可以支持任意的建议类型。
Spring AOP is designed to be extensible. While the interception implementation strategy is presently used internally, it is possible to support arbitrary advice types in addition to the interception around advice, before, throws advice, and after returning advice.
org.springframework.aop.framework.adapter
软件包是一个 SPI 软件包,在不更改核心框架的基础上,可以为新的自定义通知类型添加支持。对自定义 Advice
类型的唯一限制是它必须实现 org.aopalliance.aop.Advice
标记接口。
The org.springframework.aop.framework.adapter
package is an SPI package that lets
support for new custom advice types be added without changing the core framework.
The only constraint on a custom Advice
type is that it must implement the
org.aopalliance.aop.Advice
marker interface.
请参阅 org.springframework.aop.framework.adapter
javadoc 以了解进一步信息。
See the org.springframework.aop.framework.adapter
javadoc for further information.