Class DefaultAdvisorAdapterRegistry
java.lang.Object
org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
- All Implemented Interfaces:
- Serializable, AdvisorAdapterRegistry
public class DefaultAdvisorAdapterRegistry
extends Object
implements AdvisorAdapterRegistry, Serializable
Default implementation of the 
AdvisorAdapterRegistry interface.
Supports MethodInterceptor,
MethodBeforeAdvice,
AfterReturningAdvice,
ThrowsAdvice.- Author:
- Rod Johnson, Rob Harrop, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new DefaultAdvisorAdapterRegistry, registering well-known adapters.
- 
Method SummaryModifier and TypeMethodDescriptiongetInterceptors(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.Return anAdvisorwrapping the given advice.
- 
Constructor Details- 
DefaultAdvisorAdapterRegistrypublic DefaultAdvisorAdapterRegistry()Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.
 
- 
- 
Method Details- 
wrapDescription copied from interface:AdvisorAdapterRegistryReturn anAdvisorwrapping the given advice.Should by default at least support MethodInterceptor,MethodBeforeAdvice,AfterReturningAdvice,ThrowsAdvice.- Specified by:
- wrapin interface- AdvisorAdapterRegistry
- Parameters:
- adviceObject- an object that should be an advice
- Returns:
- an Advisor wrapping the given advice (never null; if the advice parameter is an Advisor, it is to be returned as-is)
- Throws:
- UnknownAdviceTypeException- if no registered advisor adapter can wrap the supposed advice
 
- 
getInterceptorsDescription copied from interface: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.- Specified by:
- getInterceptorsin interface- AdvisorAdapterRegistry
- Parameters:
- advisor- the Advisor to find an interceptor for
- Returns:
- an array of MethodInterceptors to expose this Advisor's behavior
- Throws:
- UnknownAdviceTypeException- if the Advisor type is not understood by any registered AdvisorAdapter
 
- 
registerAdvisorAdapterDescription copied from interface: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.- Specified by:
- registerAdvisorAdapterin interface- AdvisorAdapterRegistry
- Parameters:
- adapter- an AdvisorAdapter that understands particular Advisor or Advice types
 
 
-