类 ChannelInterceptorAdapter
- java.lang.Object
- org.springframework.messaging.support.ChannelInterceptorAdapter
- 所有已实现的接口:
ChannelInterceptor
public abstract class ChannelInterceptorAdapter extends Object implements ChannelInterceptor
AChannelInterceptorbase class with empty method implementations as a convenience.- 从以下版本开始:
- 4.0
- 作者:
- Mark Fisher, Rossen Stoyanchev
构造器概要
构造器 构造器 说明 ChannelInterceptorAdapter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterReceiveCompletion(Message<?> message, MessageChannel channel, Exception ex)Invoked after the completion of a receive regardless of any exception that have been raised thus allowing for proper resource cleanup.voidafterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex)Invoked after the completion of a send regardless of any exception that have been raised thus allowing for proper resource cleanup.Message<?>postReceive(Message<?> message, MessageChannel channel)Invoked immediately after a Message has been retrieved but before it is returned to the caller.voidpostSend(Message<?> message, MessageChannel channel, boolean sent)Invoked immediately after the send invocation.booleanpreReceive(MessageChannel channel)Invoked as soon as receive is called and before a Message is actually retrieved.Message<?>preSend(Message<?> message, MessageChannel channel)Invoked before the Message is actually sent to the channel.
构造器详细资料
ChannelInterceptorAdapter
public ChannelInterceptorAdapter()
方法详细资料
preSend
public Message<?> preSend(Message<?> message, MessageChannel channel)
从接口复制的说明:ChannelInterceptorInvoked before the Message is actually sent to the channel. This allows for modification of the Message if necessary. If this method returnsnullthen the actual send invocation will not occur.- 指定者:
preSend在接口中ChannelInterceptor
postSend
public void postSend(Message<?> message, MessageChannel channel, boolean sent)
从接口复制的说明:ChannelInterceptorInvoked immediately after the send invocation. The boolean value argument represents the return value of that invocation.- 指定者:
postSend在接口中ChannelInterceptor
afterSendCompletion
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex)
从接口复制的说明:ChannelInterceptorInvoked after the completion of a send regardless of any exception that have been raised thus allowing for proper resource cleanup.Note that this will be invoked only if
ChannelInterceptor.preSend(org.springframework.messaging.Message<?>, org.springframework.messaging.MessageChannel)successfully completed and returned a Message, i.e. it did not returnnull.- 指定者:
afterSendCompletion在接口中ChannelInterceptor
preReceive
public boolean preReceive(MessageChannel channel)
从接口复制的说明:ChannelInterceptorInvoked as soon as receive is called and before a Message is actually retrieved. If the return value is 'false', then no Message will be retrieved. This only applies to PollableChannels.- 指定者:
preReceive在接口中ChannelInterceptor
postReceive
public Message<?> postReceive(Message<?> message, MessageChannel channel)
从接口复制的说明:ChannelInterceptorInvoked immediately after a Message has been retrieved but before it is returned to the caller. The Message may be modified if necessary. This only applies to PollableChannels.- 指定者:
postReceive在接口中ChannelInterceptor
afterReceiveCompletion
public void afterReceiveCompletion(Message<?> message, MessageChannel channel, Exception ex)
从接口复制的说明:ChannelInterceptorInvoked after the completion of a receive regardless of any exception that have been raised thus allowing for proper resource cleanup.Note that this will be invoked only if
ChannelInterceptor.preReceive(org.springframework.messaging.MessageChannel)successfully completed and returnedtrue.- 指定者:
afterReceiveCompletion在接口中ChannelInterceptor