public class DefaultAdvisorAdapterRegistry extends Object implements AdvisorAdapterRegistry, Serializable
AdvisorAdapterRegistry interface.
Supports MethodInterceptor,
MethodBeforeAdvice,
AfterReturningAdvice,
ThrowsAdvice.| 构造器和说明 |
|---|
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.
|
void |
registerAdvisorAdapter(AdvisorAdapter adapter)
Register the given
AdvisorAdapter. |
Advisor |
wrap(Object adviceObject)
Return an
Advisor wrapping the given advice. |
public DefaultAdvisorAdapterRegistry()
public Advisor wrap(Object adviceObject) throws UnknownAdviceTypeException
AdvisorAdapterRegistryAdvisor wrapping the given advice.
Should by default at least support
MethodInterceptor,
MethodBeforeAdvice,
AfterReturningAdvice,
ThrowsAdvice.
wrap 在接口中 AdvisorAdapterRegistryadviceObject - object that should be an advicenull;
if the advice parameter is an Advisor, it is to be returned as-is)UnknownAdviceTypeException - if no registered advisor adapter
can wrap the supposed advicepublic MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdviceTypeException
AdvisorAdapterRegistryDon't worry about the pointcut associated with the Advisor, if it is
a PointcutAdvisor: just return an interceptor.
getInterceptors 在接口中 AdvisorAdapterRegistryadvisor - Advisor to find an interceptor forUnknownAdviceTypeException - if the Advisor type is
not understood by any registered AdvisorAdapterpublic void registerAdvisorAdapter(AdvisorAdapter adapter)
AdvisorAdapterRegistryAdvisorAdapter. Note that it is not necessary to register
adapters for an AOP Alliance Interceptors or Spring Advices: these must be
automatically recognized by an AdvisorAdapterRegistry implementation.registerAdvisorAdapter 在接口中 AdvisorAdapterRegistryadapter - AdvisorAdapter that understands particular Advisor or Advice types