Top Description Methods
org.springframework.aop.framework.adapter

public Interface AdvisorAdapterRegistry

Known Direct Implementers
org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry
Imports
org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.Advisor

Interface for registries of Advisor adapters.

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

Authors
Rod Johnson, Rob Harrop

Method Summary

Modifier and TypeMethod and Description
public MethodInterceptor[]

Returns:

an array of MethodInterceptors to expose this Advisor's behavior
getInterceptors
(Advisor
the Advisor to find an interceptor for
advisor
)

Return an array of AOP Alliance MethodInterceptors to allow use of the given Advisor in an interception-based framework.

public void
registerAdvisorAdapter(AdvisorAdapter
an AdvisorAdapter that understands particular Advisor or Advice types
adapter
)

Register the given AdvisorAdapter.

public Advisor

Returns:

an Advisor wrapping the given advice (never null; if the advice parameter is an Advisor, it is to be returned as-is)
wrap
(Object
an object that should be an advice
advice
)

Return an Advisor wrapping the given advice.

Method Detail

getInterceptorsback to summary
public MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdviceTypeException

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 is a org.springframework.aop.PointcutAdvisor: just return an interceptor.

Parameters
advisor:Advisor

the Advisor to find an interceptor for

Returns:MethodInterceptor[]

an array of MethodInterceptors to expose this Advisor's behavior

Exceptions
UnknownAdviceTypeException:
if the Advisor type is not understood by any registered AdvisorAdapter
registerAdvisorAdapterback to summary
public 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

an AdvisorAdapter that understands particular Advisor or Advice types

wrapback to summary
public Advisor wrap(Object advice) throws UnknownAdviceTypeException

Return an Advisor wrapping the given advice.

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

Parameters
advice:Object

an object that should be an advice

Returns:Advisor

an Advisor wrapping the given advice (never null; if the advice parameter is an Advisor, it is to be returned as-is)

Exceptions
UnknownAdviceTypeException:
if no registered advisor adapter can wrap the supposed advice