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

public Interface AdvisorAdapter

Known Direct Implementers
org.springframework.aop.framework.adapter.AfterReturningAdviceAdapter, org.springframework.aop.framework.adapter.MethodBeforeAdviceAdapter, org.springframework.aop.framework.adapter.ThrowsAdviceAdapter
Imports
org.aopalliance.aop.Advice, org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.Advisor

Interface allowing extension to the Spring AOP framework to allow handling of new Advisors and Advice types.

Implementing objects can create AOP Alliance Interceptors from custom advice types, enabling these advice types to be used in the Spring AOP framework, which uses interception under the covers.

There is no need for most Spring users to implement this interface; do so only if you need to introduce more Advisor or Advice types to Spring.

Author
Rod Johnson

Method Summary

Modifier and TypeMethod and Description
public MethodInterceptor

Returns:

an AOP Alliance interceptor for this Advisor. There's no need to cache instances for efficiency, as the AOP framework caches advice chains.
getInterceptor
(Advisor
the Advisor. The supportsAdvice() method must have returned true on this object
advisor
)

Return an AOP Alliance MethodInterceptor exposing the behavior of the given advice to an interception-based AOP framework.

public boolean

Returns:

whether this adapter understands the given advice object
supportsAdvice
(Advice
an Advice such as a BeforeAdvice
advice
)

Does this adapter understand this advice object?

Method Detail

getInterceptorback to summary
public MethodInterceptor getInterceptor(Advisor advisor)

Return an AOP Alliance MethodInterceptor exposing the behavior of the given advice to an interception-based AOP framework.

Don't worry about any Pointcut contained in the Advisor; the AOP framework will take care of checking the pointcut.

Parameters
advisor:Advisor

the Advisor. The supportsAdvice() method must have returned true on this object

Returns:MethodInterceptor

an AOP Alliance interceptor for this Advisor. There's no need to cache instances for efficiency, as the AOP framework caches advice chains.

supportsAdviceback to summary
public boolean supportsAdvice(Advice advice)

Does this adapter understand this advice object? Is it valid to invoke the getInterceptors method with an Advisor that contains this advice as an argument?

Parameters
advice:Advice

an Advice such as a BeforeAdvice

Returns:boolean

whether this adapter understands the given advice object

See Also
getInterceptor(org.springframework.aop.Advisor), org.springframework.aop.BeforeAdvice