接口的使用
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 ofMessagealong with a MessageBuilder and MessageHeaderAccessor for building and working with messages and message headers, as well as variousMessageChannelimplementations 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中的方法 修饰符和类型 方法 说明 ChannelRegistrationChannelRegistration. interceptors(ChannelInterceptor... interceptors)Configure the given interceptors for this message channel, adding them to the channel's current list of interceptors.ChannelRegistrationChannelRegistration. setInterceptors(ChannelInterceptor... interceptors)已过时。as of 4.3.12, in favor ofChannelRegistration.interceptors(ChannelInterceptor...)org.springframework.messaging.support中ChannelInterceptor的使用
org.springframework.messaging.support中ChannelInterceptor的子接口 修饰符和类型 接口 说明 interfaceExecutorChannelInterceptorAn extension ofChannelInterceptorwith callbacks to intercept the asynchronous sending of aMessageto a specific subscriber through anExecutor.实现ChannelInterceptor的org.springframework.messaging.support中的类 修饰符和类型 类 说明 classChannelInterceptorAdapter已过时。as of 5.0.7ChannelInterceptorhas default methods (made possible by a Java 8 baseline) and can be implemented directly without the need for this no-op adapterclassImmutableMessageChannelInterceptorA simpler interceptor that callsMessageHeaderAccessor.setImmutable()on the headers of messages passed through the preSend method.返回ChannelInterceptor的org.springframework.messaging.support中的方法 修饰符和类型 方法 说明 ChannelInterceptorAbstractMessageChannel. removeInterceptor(int index)ChannelInterceptorInterceptableChannel. 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中的方法 修饰符和类型 方法 说明 voidAbstractMessageChannel. addInterceptor(int index, ChannelInterceptor interceptor)voidAbstractMessageChannel. addInterceptor(ChannelInterceptor interceptor)voidExecutorSubscribableChannel. addInterceptor(int index, ChannelInterceptor interceptor)voidExecutorSubscribableChannel. addInterceptor(ChannelInterceptor interceptor)voidInterceptableChannel. addInterceptor(int index, ChannelInterceptor interceptor)Add a channel interceptor at the specified index.voidInterceptableChannel. addInterceptor(ChannelInterceptor interceptor)Add a channel interceptor to the end of the list.booleanAbstractMessageChannel. removeInterceptor(ChannelInterceptor interceptor)booleanInterceptableChannel. removeInterceptor(ChannelInterceptor interceptor)Remove the given interceptor.类型变量类型为ChannelInterceptor的org.springframework.messaging.support中的方法参数 修饰符和类型 方法 说明 voidAbstractMessageChannel. setInterceptors(List<ChannelInterceptor> interceptors)voidExecutorSubscribableChannel. setInterceptors(List<ChannelInterceptor> interceptors)voidInterceptableChannel. setInterceptors(List<ChannelInterceptor> interceptors)Set the list of channel interceptors clearing any existing interceptors.