接口的使用
org.springframework.messaging.support.ChannelInterceptor
使用ChannelInterceptor的程序包 程序包 说明 org.springframework.messaging.simp.config Configuration support for WebSocket messaging using higher level messaging protocols.org.springframework.messaging.support Provides implementations ofMessage
along with a MessageBuilder and MessageHeaderAccessor for building and working with messages and message headers, as well as variousMessageChannel
implementations and channel interceptor support.org.springframework.messaging.simp.config中ChannelInterceptor的使用
返回变量类型为ChannelInterceptor的类型的org.springframework.messaging.simp.config中的方法 修饰符和类型 方法 说明 protected List<ChannelInterceptor>
ChannelRegistration. getInterceptors()
参数类型为ChannelInterceptor的org.springframework.messaging.simp.config中的方法 修饰符和类型 方法 说明 ChannelRegistration
ChannelRegistration. interceptors(ChannelInterceptor... interceptors)
Configure the given interceptors for this message channel, adding them to the channel's current list of interceptors.ChannelRegistration
ChannelRegistration. setInterceptors(ChannelInterceptor... interceptors)
已过时。as of 4.3.12, in favor ofChannelRegistration.interceptors(ChannelInterceptor...)
org.springframework.messaging.support中ChannelInterceptor的使用
org.springframework.messaging.support中ChannelInterceptor的子接口 修饰符和类型 接口 说明 interface
ExecutorChannelInterceptor
An extension ofChannelInterceptor
with callbacks to intercept the asynchronous sending of aMessage
to a specific subscriber through anExecutor
.实现ChannelInterceptor的org.springframework.messaging.support中的类 修饰符和类型 类 说明 class
ChannelInterceptorAdapter
已过时。as of 5.0.7ChannelInterceptor
has default methods (made possible by a Java 8 baseline) and can be implemented directly without the need for this no-op adapterclass
ImmutableMessageChannelInterceptor
A simpler interceptor that callsMessageHeaderAccessor.setImmutable()
on the headers of messages passed through the preSend method.返回ChannelInterceptor的org.springframework.messaging.support中的方法 修饰符和类型 方法 说明 ChannelInterceptor
AbstractMessageChannel. removeInterceptor(int index)
ChannelInterceptor
InterceptableChannel. removeInterceptor(int index)
Remove the interceptor at the given index.返回变量类型为ChannelInterceptor的类型的org.springframework.messaging.support中的方法 修饰符和类型 方法 说明 List<ChannelInterceptor>
AbstractMessageChannel. getInterceptors()
List<ChannelInterceptor>
InterceptableChannel. getInterceptors()
Return the list of configured interceptors.参数类型为ChannelInterceptor的org.springframework.messaging.support中的方法 修饰符和类型 方法 说明 void
AbstractMessageChannel. addInterceptor(int index, ChannelInterceptor interceptor)
void
AbstractMessageChannel. addInterceptor(ChannelInterceptor interceptor)
void
ExecutorSubscribableChannel. addInterceptor(int index, ChannelInterceptor interceptor)
void
ExecutorSubscribableChannel. addInterceptor(ChannelInterceptor interceptor)
void
InterceptableChannel. addInterceptor(int index, ChannelInterceptor interceptor)
Add a channel interceptor at the specified index.void
InterceptableChannel. addInterceptor(ChannelInterceptor interceptor)
Add a channel interceptor to the end of the list.boolean
AbstractMessageChannel. removeInterceptor(ChannelInterceptor interceptor)
boolean
InterceptableChannel. removeInterceptor(ChannelInterceptor interceptor)
Remove the given interceptor.类型变量类型为ChannelInterceptor的org.springframework.messaging.support中的方法参数 修饰符和类型 方法 说明 void
AbstractMessageChannel. setInterceptors(List<ChannelInterceptor> interceptors)
void
ExecutorSubscribableChannel. setInterceptors(List<ChannelInterceptor> interceptors)
void
InterceptableChannel. setInterceptors(List<ChannelInterceptor> interceptors)
Set the list of channel interceptors clearing any existing interceptors.