类 DefaultAdvisorAdapterRegistry
- java.lang.Object
- org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
- 所有已实现的接口:
Serializable,AdvisorAdapterRegistry
public class DefaultAdvisorAdapterRegistry extends Object implements AdvisorAdapterRegistry, Serializable
Default implementation of theAdvisorAdapterRegistryinterface. SupportsMethodInterceptor,MethodBeforeAdvice,AfterReturningAdvice,ThrowsAdvice.- 作者:
- Rod Johnson, Rob Harrop, Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 DefaultAdvisorAdapterRegistry()Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 MethodInterceptor[]getInterceptors(Advisor advisor)Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.voidregisterAdvisorAdapter(AdvisorAdapter adapter)Register the givenAdvisorAdapter.Advisorwrap(Object adviceObject)Return anAdvisorwrapping the given advice.
构造器详细资料
DefaultAdvisorAdapterRegistry
public DefaultAdvisorAdapterRegistry()
Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.
方法详细资料
wrap
public Advisor wrap(Object adviceObject) throws UnknownAdviceTypeException
从接口复制的说明:AdvisorAdapterRegistryReturn anAdvisorwrapping the given advice.Should by default at least support
MethodInterceptor,MethodBeforeAdvice,AfterReturningAdvice,ThrowsAdvice.- 指定者:
wrap在接口中AdvisorAdapterRegistry- 参数:
adviceObject- an object that should be an advice- 返回:
- an Advisor wrapping the given advice (never
null; if the advice parameter is an Advisor, it is to be returned as-is) - 抛出:
UnknownAdviceTypeException- if no registered advisor adapter can wrap the supposed advice
getInterceptors
public MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdviceTypeException
从接口复制的说明:AdvisorAdapterRegistryReturn an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.Don't worry about the pointcut associated with the
Advisor, if it is aPointcutAdvisor: just return an interceptor.- 指定者:
getInterceptors在接口中AdvisorAdapterRegistry- 参数:
advisor- the Advisor to find an interceptor for- 返回:
- an array of MethodInterceptors to expose this Advisor's behavior
- 抛出:
UnknownAdviceTypeException- if the Advisor type is not understood by any registered AdvisorAdapter
registerAdvisorAdapter
public void registerAdvisorAdapter(AdvisorAdapter adapter)
从接口复制的说明:AdvisorAdapterRegistryRegister the givenAdvisorAdapter. Note that it is not necessary to register adapters for an AOP Alliance Interceptors or Spring Advices: these must be automatically recognized by anAdvisorAdapterRegistryimplementation.- 指定者:
registerAdvisorAdapter在接口中AdvisorAdapterRegistry- 参数:
adapter- an AdvisorAdapter that understands particular Advisor or Advice types