类 AbstractWebSocketMessageBrokerConfigurer
- java.lang.Object
- org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
- 所有已实现的接口:
WebSocketMessageBrokerConfigurer
public abstract class AbstractWebSocketMessageBrokerConfigurer extends Object implements WebSocketMessageBrokerConfigurer
A convenient abstract base class forWebSocketMessageBrokerConfigurerimplementations providing empty method implementations for optional methods.- 从以下版本开始:
- 4.0.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 AbstractWebSocketMessageBrokerConfigurer()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)Add resolvers to support custom controller method argument types.voidaddReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)Add handlers to support custom controller method return value types.voidconfigureClientInboundChannel(ChannelRegistration registration)Configure theMessageChannelused for incoming messages from WebSocket clients.voidconfigureClientOutboundChannel(ChannelRegistration registration)Configure theMessageChannelused for outbound messages to WebSocket clients.voidconfigureMessageBroker(MessageBrokerRegistry registry)Configure message broker options.booleanconfigureMessageConverters(List<MessageConverter> messageConverters)Configure the message converters to use when extracting the payload of messages in annotated methods and when sending messages (e.g. through the "broker" SimpMessagingTemplate).voidconfigureWebSocketTransport(WebSocketTransportRegistration registration)Configure options related to the processing of messages received from and sent to WebSocket clients.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
registerStompEndpoints
构造器详细资料
AbstractWebSocketMessageBrokerConfigurer
public AbstractWebSocketMessageBrokerConfigurer()
方法详细资料
configureWebSocketTransport
public void configureWebSocketTransport(WebSocketTransportRegistration registration)
从接口复制的说明:WebSocketMessageBrokerConfigurerConfigure options related to the processing of messages received from and sent to WebSocket clients.
configureClientInboundChannel
public void configureClientInboundChannel(ChannelRegistration registration)
从接口复制的说明:WebSocketMessageBrokerConfigurerConfigure theMessageChannelused for incoming messages from WebSocket clients. By default the channel is backed by a thread pool of size 1. It is recommended to customize thread pool settings for production use.
configureClientOutboundChannel
public void configureClientOutboundChannel(ChannelRegistration registration)
从接口复制的说明:WebSocketMessageBrokerConfigurerConfigure theMessageChannelused for outbound messages to WebSocket clients. By default the channel is backed by a thread pool of size 1. It is recommended to customize thread pool settings for production use.
configureMessageConverters
public boolean configureMessageConverters(List<MessageConverter> messageConverters)
从接口复制的说明:WebSocketMessageBrokerConfigurerConfigure the message converters to use when extracting the payload of messages in annotated methods and when sending messages (e.g. through the "broker" SimpMessagingTemplate).The provided list, initially empty, can be used to add message converters while the boolean return value is used to determine if default message should be added as well.
- 指定者:
configureMessageConverters在接口中WebSocketMessageBrokerConfigurer- 参数:
messageConverters- the converters to configure (initially an empty list)- 返回:
- whether to also add default converter or not
addArgumentResolvers
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
从接口复制的说明:WebSocketMessageBrokerConfigurerAdd resolvers to support custom controller method argument types.This does not override the built-in support for resolving handler method arguments. To customize the built-in support for argument resolution, configure
SimpAnnotationMethodMessageHandlerdirectly.- 指定者:
addArgumentResolvers在接口中WebSocketMessageBrokerConfigurer- 参数:
argumentResolvers- the resolvers to register (initially an empty list)
addReturnValueHandlers
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
从接口复制的说明:WebSocketMessageBrokerConfigurerAdd handlers to support custom controller method return value types.Using this option does not override the built-in support for handling return values. To customize the built-in support for handling return values, configure
SimpAnnotationMethodMessageHandlerdirectly.- 指定者:
addReturnValueHandlers在接口中WebSocketMessageBrokerConfigurer- 参数:
returnValueHandlers- the handlers to register (initially an empty list)
configureMessageBroker
public void configureMessageBroker(MessageBrokerRegistry registry)
从接口复制的说明:WebSocketMessageBrokerConfigurerConfigure message broker options.