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
- Version: $Id: AdvisorAdapterRegistry.java,v 1.2 2003/12/11 16:51:26 johnsonr Exp $
getInterceptor
public Interceptor getInterceptor(Advisor advisor)
throws UnknownAdviceTypeException
- Return an AOP Alliance Interceptor 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 Interceptor to expose this Advisor's behaviour
- Throws:
- UnknownAdviceTypeException - if the Advisor type is
not understood by any registered AdvisorAdapter.
registerAdvisorAdapter
public void registerAdvisorAdapter(AdvisorAdapter adapter)
- Register the given AdvisorAdapter. Note that it is not necessary to register
adapters for InterceptionAroundAdvice or AOP Alliance Interceptors:
these must be automatically recognized by an AdvisorAdapterRegistry
implementation.
- Parameters:
- adapter - AdvisorAdapter that understands particular Advisor
and Advice types.
wrap
public Advisor wrap(Object advice)
throws UnknownAdviceTypeException
- Return an Advisor wrapping the given advice
- Parameters:
- advice - object that should be an advice, such as
BeforeAdvice or ThrowsAdvice.
- 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