001/*
002 * Copyright 2002-2018 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.messaging.support;
018
019import org.springframework.lang.Nullable;
020import org.springframework.messaging.Message;
021import org.springframework.messaging.MessageChannel;
022
023/**
024 * A {@link ChannelInterceptor} base class with empty method implementations
025 * as a convenience.
026 *
027 * @author Mark Fisher
028 * @author Rossen Stoyanchev
029 * @since 4.0
030 * @deprecated as of 5.0.7 {@link ChannelInterceptor} has default methods (made
031 * possible by a Java 8 baseline) and can be implemented directly without the
032 * need for this no-op adapter
033 */
034@Deprecated
035public abstract class ChannelInterceptorAdapter implements ChannelInterceptor {
036
037        @Override
038        public Message<?> preSend(Message<?> message, MessageChannel channel) {
039                return message;
040        }
041
042        @Override
043        public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
044        }
045
046        @Override
047        public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, @Nullable Exception ex) {
048        }
049
050        @Override
051        public boolean preReceive(MessageChannel channel) {
052                return true;
053        }
054
055        @Override
056        public Message<?> postReceive(Message<?> message, MessageChannel channel) {
057                return message;
058        }
059
060        @Override
061        public void afterReceiveCompletion(@Nullable Message<?> message, MessageChannel channel, @Nullable Exception ex) {
062        }
063
064}