站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

AdvisorAdapter (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.aop.framework.adapter
Interface AdvisorAdapter


public interface AdvisorAdapter

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
 MethodInterceptor getInterceptor(Advisor advisor)
          Return an AOP Alliance MethodInterceptor exposing the behavior of the given advice to an interception-based AOP framework.
 boolean supportsAdvice(Advice advice)
          Does this adapter understand this advice object?
 

Method Detail

supportsAdvice

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 - an Advice such as a BeforeAdvice
Returns:
whether this adapter understands the given advice object
See Also:
getInterceptor(org.springframework.aop.Advisor), BeforeAdvice

getInterceptor

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 - the Advisor. The supportsAdvice() method must have returned true on this object
Returns:
an AOP Alliance interceptor for this Advisor. There's no need to cache instances for efficiency, as the AOP framework caches advice chains.

The Spring Framework

Copyright © 2002-2007 The Spring Framework.