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 forWebSocketMessageBrokerConfigurerimplementations 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 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.voidconfigureWebSocketTransport(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:WebSocketMessageBrokerConfigurerConfigure options related to the processing of messages received from and sent to WebSocket clients.- Specified by:
configureWebSocketTransportin interfaceWebSocketMessageBrokerConfigurer
configureClientInboundChannel
public void configureClientInboundChannel(ChannelRegistration registration)
Description copied from interface: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.- Specified by:
configureClientInboundChannelin interfaceWebSocketMessageBrokerConfigurer
configureClientOutboundChannel
public void configureClientOutboundChannel(ChannelRegistration registration)
Description copied from interface: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.- Specified by:
configureClientOutboundChannelin interfaceWebSocketMessageBrokerConfigurer
configureMessageConverters
public boolean configureMessageConverters(List<MessageConverter> messageConverters)
Description copied from interface: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.
- Specified by:
configureMessageConvertersin 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: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.- Specified by:
addArgumentResolversin interfaceWebSocketMessageBrokerConfigurer- Parameters:
argumentResolvers- the resolvers to register (initially an empty list)
addReturnValueHandlers
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers)
Description copied from interface: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.- Specified by:
addReturnValueHandlersin interfaceWebSocketMessageBrokerConfigurer- Parameters:
returnValueHandlers- the handlers to register (initially an empty list)
configureMessageBroker
public void configureMessageBroker(MessageBrokerRegistry registry)
Description copied from interface:WebSocketMessageBrokerConfigurerConfigure message broker options.- Specified by:
configureMessageBrokerin interfaceWebSocketMessageBrokerConfigurer