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

Method Summary
 Interceptor getInterceptor(Advisor advisor)
          Return an AOP Alliance Interceptor 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

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

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 behavior
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


Copyright (C) 2003-2004 The Spring Framework Project.