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

public Class DefaultAdvisorAdapterRegistry

extends Object
implements AdvisorAdapterRegistry, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.springframework.aop.framework.adapter.AdvisorAdapterRegistry
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, java.util.ArrayList, .List, org.aopalliance.aop.Advice, org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.Advisor, org.springframework.aop.support.DefaultPointcutAdvisor

Default implementation of the AdvisorAdapterRegistry interface. Supports org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.MethodBeforeAdvice, org.springframework.aop.AfterReturningAdvice, org.springframework.aop.ThrowsAdvice.
Authors
Rod Johnson, Rob Harrop, Juergen Hoeller

Field Summary

Modifier and TypeField and Description
private final List<AdvisorAdapter>

Constructor Summary

AccessConstructor and Description
public
DefaultAdvisorAdapterRegistry()

Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.

Method Summary

Modifier and TypeMethod and Description
public MethodInterceptor[]
getInterceptors(Advisor
the Advisor to find an interceptor for
advisor
)

Implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.getInterceptors.

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
)

Implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.registerAdvisorAdapter.

Register the given AdvisorAdapter.
public Advisor
wrap(Object
an object that should be an advice
adviceObject
)

Implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.wrap.

Return an Advisor wrapping the given advice.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adaptersback to summary
private final List<AdvisorAdapter> adapters

Constructor Detail

DefaultAdvisorAdapterRegistryback to summary
public DefaultAdvisorAdapterRegistry()

Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.

Method Detail

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

Implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.getInterceptors.

Doc from org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.getInterceptors.

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

Annotations
@Override
Exceptions
UnknownAdviceTypeException:
if the Advisor type is not understood by any registered AdvisorAdapter
registerAdvisorAdapterback to summary
public void registerAdvisorAdapter(AdvisorAdapter adapter)

Implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.registerAdvisorAdapter.

Doc from org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.registerAdvisorAdapter.

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

Annotations
@Override
wrapback to summary
public Advisor wrap(Object adviceObject) throws UnknownAdviceTypeException

Implements org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.wrap.

Doc from org.springframework.aop.framework.adapter.AdvisorAdapterRegistry.wrap.

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
adviceObject: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)

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