FactoryBean, BeanPostProcessor and HandlerInterceptor variants declared with default methods
Issue: SPR-14432
This commit is contained in:
@@ -84,6 +84,7 @@ public interface HandlerInterceptor {
|
||||
* <p><strong>Note:</strong> special considerations apply for asynchronous
|
||||
* request processing. For more details see
|
||||
* {@link org.springframework.web.servlet.AsyncHandlerInterceptor}.
|
||||
* <p>The default implementation returns {@code true}.
|
||||
* @param request current HTTP request
|
||||
* @param response current HTTP response
|
||||
* @param handler chosen handler to execute, for type and/or instance evaluation
|
||||
@@ -92,8 +93,11 @@ public interface HandlerInterceptor {
|
||||
* that this interceptor has already dealt with the response itself.
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws Exception;
|
||||
default boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intercept the execution of a handler. Called after HandlerAdapter actually
|
||||
@@ -106,6 +110,7 @@ public interface HandlerInterceptor {
|
||||
* <p><strong>Note:</strong> special considerations apply for asynchronous
|
||||
* request processing. For more details see
|
||||
* {@link org.springframework.web.servlet.AsyncHandlerInterceptor}.
|
||||
* <p>The default implementation is empty.
|
||||
* @param request current HTTP request
|
||||
* @param response current HTTP response
|
||||
* @param handler handler (or {@link HandlerMethod}) that started asynchronous
|
||||
@@ -114,8 +119,10 @@ public interface HandlerInterceptor {
|
||||
* (can also be {@code null})
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception;
|
||||
default void postHandle(
|
||||
HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback after completion of request processing, that is, after rendering
|
||||
@@ -129,6 +136,7 @@ public interface HandlerInterceptor {
|
||||
* <p><strong>Note:</strong> special considerations apply for asynchronous
|
||||
* request processing. For more details see
|
||||
* {@link org.springframework.web.servlet.AsyncHandlerInterceptor}.
|
||||
* <p>The default implementation is empty.
|
||||
* @param request current HTTP request
|
||||
* @param response current HTTP response
|
||||
* @param handler handler (or {@link HandlerMethod}) that started asynchronous
|
||||
@@ -136,7 +144,9 @@ public interface HandlerInterceptor {
|
||||
* @param ex exception thrown on handler execution, if any
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
|
||||
throws Exception;
|
||||
default void afterCompletion(
|
||||
HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user