public class DefaultAdvisorAdapterRegistry extends java.lang.Object implements AdvisorAdapterRegistry, java.io.Serializable
AdvisorAdapterRegistry interface.
Supports MethodInterceptor,
MethodBeforeAdvice,
AfterReturningAdvice,
ThrowsAdvice.| Constructor and Description |
|---|
DefaultAdvisorAdapterRegistry()
Create a new DefaultAdvisorAdapterRegistry, registering well-known adapters.
|
| Modifier and Type | Method and Description |
|---|---|
MethodInterceptor[] |
getInterceptors(Advisor advisor)
Return an array of AOP Alliance MethodInterceptors to allow use of the
given Advisor in an interception-based framework.
|
void |
registerAdvisorAdapter(AdvisorAdapter adapter)
Register the given AdvisorAdapter.
|
Advisor |
wrap(java.lang.Object adviceObject)
Return an Advisor wrapping the given advice.
|
public DefaultAdvisorAdapterRegistry()
public Advisor wrap(java.lang.Object adviceObject) throws UnknownAdviceTypeException
AdvisorAdapterRegistryShould by default at least support
MethodInterceptor,
MethodBeforeAdvice,
AfterReturningAdvice,
ThrowsAdvice.
wrap in interface AdvisorAdapterRegistryadviceObject - object that should be an advicenull.
If the advice parameter is an Advisor, return it.UnknownAdviceTypeException - if no registered advisor adapter
can wrap the supposed advicepublic MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdviceTypeException
AdvisorAdapterRegistryDon't worry about the pointcut associated with the Advisor, if it's a PointcutAdvisor: just return an interceptor.
getInterceptors in interface AdvisorAdapterRegistryadvisor - Advisor to find an interceptor forUnknownAdviceTypeException - if the Advisor type is
not understood by any registered AdvisorAdapter.public void registerAdvisorAdapter(AdvisorAdapter adapter)
AdvisorAdapterRegistryregisterAdvisorAdapter in interface AdvisorAdapterRegistryadapter - AdvisorAdapter that understands a particular Advisor
or Advice types