001/* 002 * Copyright 2002-2015 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.web.context.request.async; 018 019import org.springframework.web.context.request.NativeWebRequest; 020 021/** 022 * Abstract adapter class for the {@link DeferredResultProcessingInterceptor} 023 * interface for simplified implementation of individual methods. 024 * 025 * @author Rossen Stoyanchev 026 * @author Rob Winch 027 * @since 3.2 028 */ 029public abstract class DeferredResultProcessingInterceptorAdapter implements DeferredResultProcessingInterceptor { 030 031 /** 032 * This implementation is empty. 033 */ 034 @Override 035 public <T> void beforeConcurrentHandling(NativeWebRequest request, DeferredResult<T> deferredResult) 036 throws Exception { 037 } 038 039 /** 040 * This implementation is empty. 041 */ 042 @Override 043 public <T> void preProcess(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception { 044 } 045 046 /** 047 * This implementation is empty. 048 */ 049 @Override 050 public <T> void postProcess(NativeWebRequest request, DeferredResult<T> deferredResult, 051 Object concurrentResult) throws Exception { 052 } 053 054 /** 055 * This implementation returns {@code true} by default allowing other interceptors 056 * to be given a chance to handle the timeout. 057 */ 058 @Override 059 public <T> boolean handleTimeout(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception { 060 return true; 061 } 062 063 /** 064 * This implementation is empty. 065 */ 066 @Override 067 public <T> void afterCompletion(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception { 068 } 069 070}