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 java.util.concurrent.Callable; 020 021import org.springframework.web.context.request.NativeWebRequest; 022 023/** 024 * Abstract adapter class for the {@link CallableProcessingInterceptor} interface, 025 * for simplified implementation of individual methods. 026 * 027 * @author Rossen Stoyanchev 028 * @author Rob Winch 029 * @since 3.2 030 */ 031public abstract class CallableProcessingInterceptorAdapter implements CallableProcessingInterceptor { 032 033 /** 034 * This implementation is empty. 035 */ 036 @Override 037 public <T> void beforeConcurrentHandling(NativeWebRequest request, Callable<T> task) throws Exception { 038 } 039 040 /** 041 * This implementation is empty. 042 */ 043 @Override 044 public <T> void preProcess(NativeWebRequest request, Callable<T> task) throws Exception { 045 } 046 047 /** 048 * This implementation is empty. 049 */ 050 @Override 051 public <T> void postProcess(NativeWebRequest request, Callable<T> task, Object concurrentResult) throws Exception { 052 } 053 054 /** 055 * This implementation always returns 056 * {@link CallableProcessingInterceptor#RESULT_NONE RESULT_NONE}. 057 */ 058 @Override 059 public <T> Object handleTimeout(NativeWebRequest request, Callable<T> task) throws Exception { 060 return RESULT_NONE; 061 } 062 063 /** 064 * This implementation is empty. 065 */ 066 @Override 067 public <T> void afterCompletion(NativeWebRequest request, Callable<T> task) throws Exception { 068 } 069 070}