001/*
002 * Copyright 2002-2017 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 * @deprecated as of 5.0 where DeferredResultProcessingInterceptor has default methods
029 */
030@Deprecated
031public abstract class DeferredResultProcessingInterceptorAdapter implements DeferredResultProcessingInterceptor {
032
033        /**
034         * This implementation is empty.
035         */
036        @Override
037        public <T> void beforeConcurrentHandling(NativeWebRequest request, DeferredResult<T> deferredResult)
038                        throws Exception {
039        }
040
041        /**
042         * This implementation is empty.
043         */
044        @Override
045        public <T> void preProcess(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception {
046        }
047
048        /**
049         * This implementation is empty.
050         */
051        @Override
052        public <T> void postProcess(NativeWebRequest request, DeferredResult<T> deferredResult,
053                        Object concurrentResult) throws Exception {
054        }
055
056        /**
057         * This implementation returns {@code true} by default allowing other interceptors
058         * to be given a chance to handle the timeout.
059         */
060        @Override
061        public <T> boolean handleTimeout(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception {
062                return true;
063        }
064
065        /**
066         * This implementation returns {@code true} by default allowing other interceptors
067         * to be given a chance to handle the error.
068         */
069        @Override
070        public <T> boolean handleError(NativeWebRequest request, DeferredResult<T> deferredResult, Throwable t)
071                        throws Exception {
072                return true;
073        }
074
075        /**
076         * This implementation is empty.
077         */
078        @Override
079        public <T> void afterCompletion(NativeWebRequest request, DeferredResult<T> deferredResult) throws Exception {
080        }
081
082}