public interface

AdvisorAdapterRegistry

org.springframework.aop.framework.adapter.AdvisorAdapterRegistry
Known Indirect Subclasses

Class Overview

Interface for registries of Advisor adapters.

This is an SPI interface, not to be implemented by any Spring user.

Summary

Public Methods
abstract MethodInterceptor[] getInterceptors(Advisor advisor)
Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.
abstract void registerAdvisorAdapter(AdvisorAdapter adapter)
Register the given AdvisorAdapter.
abstract Advisor wrap(Object advice)
Return an Advisor wrapping the given advice.

Public Methods

public abstract MethodInterceptor[] getInterceptors (Advisor advisor)

Return 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's a PointcutAdvisor: just return an interceptor.

Parameters
advisor 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.

public abstract void registerAdvisorAdapter (AdvisorAdapter adapter)

Register the given AdvisorAdapter. 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.

Parameters
adapter AdvisorAdapter that understands a particular Advisor or Advice types

public abstract Advisor wrap (Object advice)

Return an Advisor wrapping the given advice.

Should by default at least support org.aopalliance.intercept.MethodInterceptor, MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice.

Parameters
advice object that should be an advice
Returns
  • an Advisor wrapping the given advice. Never returns null. If the advice parameter is an Advisor, return it.
Throws
UnknownAdviceTypeException if no registered advisor adapter can wrap the supposed advice