Interface HandlerMethodAdvice
- All Known Implementing Classes:
DelegatingHandlerMethodAdvice
public interface HandlerMethodAdvice
Intercepting
HandlerMethod
facade interface- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault 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 aHandlerMethod
.default void
afterResolveArgument
(org.springframework.core.MethodParameter parameter, Object resolvedArgument, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) callback after theMethodParameter
being resolveddefault void
beforeExecuteMethod
(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) Interception point before the execution of aHandlerMethod
.default void
beforeResolveArgument
(org.springframework.core.MethodParameter parameter, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) callback before theMethodParameter
being resolved
-
Method Details
-
beforeResolveArgument
default void beforeResolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception callback before theMethodParameter
being resolved- Parameters:
parameter
- the method parameter to resolve.handlerMethod
- the method to handlewebRequest
- the current request- Throws:
Exception
- in case of errors with the preparation of argument values
-
afterResolveArgument
default void afterResolveArgument(org.springframework.core.MethodParameter parameter, Object resolvedArgument, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception callback after theMethodParameter
being resolved- Parameters:
parameter
- the method parameter to resolve.resolvedArgument
- the resolved argumenthandlerMethod
- the method to handlewebRequest
- the current request- Throws:
Exception
- in case of errors with the preparation of argument values
-
beforeExecuteMethod
default void beforeExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) throws Exception Interception point before the execution of aHandlerMethod
. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.- Parameters:
handlerMethod
-HandlerMethod
args
- the resolved arguments ofHandlerMethod
request
-WebRequest
- Throws:
Exception
- if any error caused
-
afterExecuteMethod
default void afterExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, @Nullable Object returnValue, @Nullable Throwable error, org.springframework.web.context.request.NativeWebRequest request) throws Exception Interception point after successful execution of aHandlerMethod
. Called after HandlerAdapter actually invoked the handler.- Parameters:
handlerMethod
-HandlerMethod
args
- the resolved arguments ofHandlerMethod
returnValue
- the return value ofHandlerMethod
error
- the error afterHandlerMethod
invocationrequest
-WebRequest
- Throws:
Exception
- if any error caused
-