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

AdvisorAdapterRegistry (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.aop.framework.adapter
Interface AdvisorAdapterRegistry

All Known Implementing Classes:
DefaultAdvisorAdapterRegistry

public interface AdvisorAdapterRegistry

Interface for registries of AdvisorAdapters.

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

Author:
Rod Johnson, Rob Harrop

Method Summary
 Interceptor[] getInterceptors(Advisor advisor)
          Return an array of AOP Alliance Interceptors to allow use of the given Advisor in an interception-based framework.
 void registerAdvisorAdapter(AdvisorAdapter adapter)
          Register the given AdvisorAdapter.
 Advisor wrap(Object advice)
          Return an Advisor wrapping the given advice.
 

Method Detail

wrap

Advisor wrap(Object advice)
             throws UnknownAdviceTypeException
Return an Advisor wrapping the given advice.

Should by default at least support Interceptor, BeforeAdvice, 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 AdvisorAdapter can wrap the supposed advice
See Also:
Interceptor, BeforeAdvice, AfterReturningAdvice, ThrowsAdvice

getInterceptors

Interceptor[] getInterceptors(Advisor advisor)
                              throws UnknownAdviceTypeException
Return an array of AOP Alliance Interceptors 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 Interceptors to expose this Advisor's behavior
Throws:
UnknownAdviceTypeException - if the Advisor type is not understood by any registered AdvisorAdapter.

registerAdvisorAdapter

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


Copyright (c) 2002-2007 The Spring Framework Project.