Class AbstractWebSocketMessageBrokerConfigurer
- java.lang.Object
- org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
- All Implemented Interfaces:
WebSocketMessageBrokerConfigurer
public abstract class AbstractWebSocketMessageBrokerConfigurer extends Object implements WebSocketMessageBrokerConfigurer
A convenient abstract base class forWebSocketMessageBrokerConfigurer
implementations providing empty method implementations for optional methods.- Since:
- 4.0.1
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description AbstractWebSocketMessageBrokerConfigurer()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
Add resolvers to support custom controller method argument types.void
addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Add handlers to support custom controller method return value types.void
configureClientInboundChannel(ChannelRegistration registration)
Configure theMessageChannel
used for incoming messages from WebSocket clients.void
configureClientOutboundChannel(ChannelRegistration registration)
Configure theMessageChannel
used for outbound messages to WebSocket clients.void
configureMessageBroker(MessageBrokerRegistry registry)
Configure message broker options.boolean
configureMessageConverters(List<MessageConverter> messageConverters)
Configure the message converters to use when extracting the payload of messages in annotated methods and when sending messages (e.g.void
configureWebSocketTransport(WebSocketTransportRegistration registration)
Configure options related to the processing of messages received from and sent to WebSocket clients.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
registerStompEndpoints
Constructor Detail
AbstractWebSocketMessageBrokerConfigurer
public AbstractWebSocketMessageBrokerConfigurer()
Method Detail
configureWebSocketTransport
public void configureWebSocketTransport(WebSocketTransportRegistration registration)
Description copied from interface:WebSocketMessageBrokerConfigurer
Configure options related to the processing of messages received from and sent to WebSocket clients.- Specified by:
configureWebSocketTransport
in interfaceWebSocketMessageBrokerConfigurer
configureClientInboundChannel
public void configureClientInboundChannel(ChannelRegistration registration)
Description copied from interface:WebSocketMessageBrokerConfigurer
Configure theMessageChannel
used 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.- Specified by:
configureClientInboundChannel
in interfaceWebSocketMessageBrokerConfigurer
configureClientOutboundChannel
public void configureClientOutboundChannel(ChannelRegistration registration)
Description copied from interface:WebSocketMessageBrokerConfigurer
Configure theMessageChannel
used 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.- Specified by:
configureClientOutboundChannel
in interfaceWebSocketMessageBrokerConfigurer
configureMessageConverters
public boolean configureMessageConverters(List<MessageConverter> messageConverters)
Description copied from interface:WebSocketMessageBrokerConfigurer
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).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.
- Specified by:
configureMessageConverters
in interfaceWebSocketMessageBrokerConfigurer
- Parameters:
messageConverters
- the converters to configure (initially an empty list)- Returns:
- whether to also add default converter or not
addArgumentResolvers
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers)
Description copied from interface:WebSocketMessageBrokerConfigurer
Add 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
SimpAnnotationMethodMessageHandler
directly.- Specified by:
addArgumentResolvers
in interfaceWebSocketMessageBrokerConfigurer
- Parameters:
argumentResolvers
- the resolvers to register (initially an empty list)
addReturnValueHandlers
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Description copied from interface:WebSocketMessageBrokerConfigurer
Add 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
SimpAnnotationMethodMessageHandler
directly.- Specified by:
addReturnValueHandlers
in interfaceWebSocketMessageBrokerConfigurer
- Parameters:
returnValueHandlers
- the handlers to register (initially an empty list)
configureMessageBroker
public void configureMessageBroker(MessageBrokerRegistry registry)
Description copied from interface:WebSocketMessageBrokerConfigurer
Configure message broker options.- Specified by:
configureMessageBroker
in interfaceWebSocketMessageBrokerConfigurer