spring-framework / org.springframework.aop.framework.adapter

Package org.springframework.aop.framework.adapter

Types

AdvisorAdapter

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.

AdvisorAdapterRegistrationManager

open class AdvisorAdapterRegistrationManager : BeanPostProcessor

BeanPostProcessor that registers AdvisorAdapter beans in the BeanFactory with an AdvisorAdapterRegistry (by default the GlobalAdvisorAdapterRegistry).

The only requirement for it to work is that it needs to be defined in application context along with "non-native" Spring AdvisorAdapters that need to be "recognized" by Spring's AOP framework.

AfterReturningAdviceInterceptor

open class AfterReturningAdviceInterceptor : MethodInterceptor, AfterAdvice, Serializable

Interceptor to wrap an org.springframework.aop.AfterReturningAdvice. Used internally by the AOP framework; application developers should not need to use this class directly.

DefaultAdvisorAdapterRegistry

open class DefaultAdvisorAdapterRegistry : AdvisorAdapterRegistry, Serializable

Default implementation of the AdvisorAdapterRegistry interface. Supports org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.MethodBeforeAdvice, org.springframework.aop.AfterReturningAdvice, org.springframework.aop.ThrowsAdvice.

GlobalAdvisorAdapterRegistry

abstract class GlobalAdvisorAdapterRegistry

Singleton to publish a shared DefaultAdvisorAdapterRegistry instance.

MethodBeforeAdviceInterceptor

open class MethodBeforeAdviceInterceptor : MethodInterceptor, Serializable

Interceptor to wrap am org.springframework.aop.MethodBeforeAdvice. Used internally by the AOP framework; application developers should not need to use this class directly.

ThrowsAdviceInterceptor

open class ThrowsAdviceInterceptor : MethodInterceptor, AfterAdvice

Interceptor to wrap an after-throwing advice.

The signatures on handler methods on the ThrowsAdvice implementation method argument must be of the form: void afterThrowing([Method, args, target], ThrowableSubclass);

Only the last argument is required.

Some examples of valid methods would be:

public void afterThrowing(Exception ex)
public void afterThrowing(RemoteException)
public void afterThrowing(Method method, Object[] args, Object target, Exception ex)
public void afterThrowing(Method method, Object[] args, Object target, ServletException ex)

This is a framework class that need not be used directly by Spring users.

Exceptions

UnknownAdviceTypeException

open class UnknownAdviceTypeException : IllegalArgumentException

Exception thrown when an attempt is made to use an unsupported Advisor or Advice type.