Class DelegatingHandlerMethodAdvice

java.lang.Object
io.microsphere.spring.context.event.OnceApplicationContextEventListener<org.springframework.context.event.ContextRefreshedEvent>
io.microsphere.spring.web.method.support.DelegatingHandlerMethodAdvice
All Implemented Interfaces:
HandlerMethodAdvice, EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>

public class DelegatingHandlerMethodAdvice extends OnceApplicationContextEventListener<org.springframework.context.event.ContextRefreshedEvent> implements HandlerMethodAdvice
Since:
1.0.0
Author:
Mercy
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, Object returnValue, Throwable error, org.springframework.web.context.request.NativeWebRequest request)
    Interception point after successful execution of a HandlerMethod.
    void
    afterResolveArgument(org.springframework.core.MethodParameter parameter, Object resolvedArgument, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest)
    callback after the MethodParameter being resolved
    void
    beforeExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request)
    Interception point before the execution of a HandlerMethod.
    void
    beforeResolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest)
    callback before the MethodParameter being resolved
    protected void
    onApplicationContextEvent(org.springframework.context.event.ContextRefreshedEvent event)
     

    Methods inherited from class io.microsphere.spring.context.event.OnceApplicationContextEventListener

    getApplicationContext, onApplicationEvent, setApplicationContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.ApplicationListener

    supportsAsyncExecution
  • Field Details

  • Constructor Details

    • DelegatingHandlerMethodAdvice

      public DelegatingHandlerMethodAdvice()
  • Method Details

    • onApplicationContextEvent

      protected void onApplicationContextEvent(org.springframework.context.event.ContextRefreshedEvent event)
      Specified by:
      onApplicationContextEvent in class OnceApplicationContextEventListener<org.springframework.context.event.ContextRefreshedEvent>
    • beforeResolveArgument

      public void beforeResolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception
      Description copied from interface: HandlerMethodAdvice
      callback before the MethodParameter being resolved
      Specified by:
      beforeResolveArgument in interface HandlerMethodAdvice
      Parameters:
      parameter - the method parameter to resolve.
      handlerMethod - the method to handle
      webRequest - the current request
      Throws:
      Exception - in case of errors with the preparation of argument values
    • afterResolveArgument

      public void afterResolveArgument(org.springframework.core.MethodParameter parameter, Object resolvedArgument, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception
      Description copied from interface: HandlerMethodAdvice
      callback after the MethodParameter being resolved
      Specified by:
      afterResolveArgument in interface HandlerMethodAdvice
      Parameters:
      parameter - the method parameter to resolve.
      resolvedArgument - the resolved argument
      handlerMethod - the method to handle
      webRequest - the current request
      Throws:
      Exception - in case of errors with the preparation of argument values
    • beforeExecuteMethod

      public void beforeExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) throws Exception
      Description copied from interface: HandlerMethodAdvice
      Interception point before the execution of a HandlerMethod. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.
      Specified by:
      beforeExecuteMethod in interface HandlerMethodAdvice
      Parameters:
      handlerMethod - HandlerMethod
      args - the resolved arguments of HandlerMethod
      request - WebRequest
      Throws:
      Exception - if any error caused
    • afterExecuteMethod

      public void afterExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, Object returnValue, Throwable error, org.springframework.web.context.request.NativeWebRequest request) throws Exception
      Description copied from interface: HandlerMethodAdvice
      Interception point after successful execution of a HandlerMethod. Called after HandlerAdapter actually invoked the handler.
      Specified by:
      afterExecuteMethod in interface HandlerMethodAdvice
      Parameters:
      handlerMethod - HandlerMethod
      args - the resolved arguments of HandlerMethod
      returnValue - the return value of HandlerMethod
      error - the error after HandlerMethod invocation
      request - WebRequest
      Throws:
      Exception - if any error caused