@Configuration public class DefaultWampConfiguration extends Object
EnableWamp to any @Configuration class.
If you overwrite a method annotated with @Bean, don't forget to add the annotation @Bean to the overridden method as well.
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.core.convert.ConversionService |
internalConversionService |
protected com.fasterxml.jackson.databind.ObjectMapper |
internalObjectMapper |
protected org.springframework.util.PathMatcher |
internalPathMatcher |
| Constructor and Description |
|---|
DefaultWampConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
void |
addArgumentResolvers(List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> argumentResolvers) |
protected void |
addHandshakeInterceptors(List<org.springframework.web.socket.server.HandshakeInterceptor> handshakeInterceptors) |
org.springframework.messaging.MessageHandler |
annotationMethodMessageHandler(org.springframework.context.ConfigurableApplicationContext configurableApplicationContext) |
AuthenticationHandler |
authenticationHandler()
Configures an implementation of the
AuthenticationHandler interface. |
boolean |
authenticationRequired()
When this method returns true, all calls to a wamp server endpoint (methods
annotated with
WampCallListener, WampPublishListener,
WampSubscribeListener or WampUnsubscribeListener) have to be
authenticated. |
AuthenticationSecretProvider |
authenticationSecretProvider()
Configures an implementation of the secret provider interface
AuthenticationSecretProvider for authentication. |
org.springframework.messaging.SubscribableChannel |
brokerChannel()
Channel from the application to the
brokerMessageHandler() |
Executor |
brokerChannelExecutor()
Executor used by the
brokerChannel(). |
org.springframework.messaging.MessageHandler |
brokerMessageHandler() |
protected WampMessageSelector |
brokerMessageHandlerMessageSelector() |
org.springframework.messaging.SubscribableChannel |
clientInboundChannel()
Channel for inbound messages between
WampSubProtocolHandler,
brokerMessageHandler() and #annotationMethodMessageHandler() |
Executor |
clientInboundChannelExecutor() |
org.springframework.messaging.SubscribableChannel |
clientOutboundChannel()
Channel for outbound messages sent back to WebSocket clients.
|
Executor |
clientOutboundChannelExecutor() |
protected void |
configureClientInboundChannel(org.springframework.messaging.support.AbstractMessageChannel channel) |
void |
configureWebSocketTransport(WebSocketTransportRegistration registration)
Configure options related to the processing of messages received from and sent to
WebSocket clients.
|
org.springframework.core.convert.ConversionService |
conversionService()
Returns a ConversionService that is used for argument conversion
|
protected org.springframework.web.socket.WebSocketHandler |
decorateWebSocketHandler(org.springframework.web.socket.WebSocketHandler handler) |
EventMessenger |
eventMessenger() |
protected WebSocketTransportRegistration |
getTransportRegistration() |
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler |
messageBrokerSockJsTaskScheduler()
The default TaskScheduler to use if none is configured via
SockJsServiceRegistration.setTaskScheduler(org.springframework.scheduling.TaskScheduler)
, i.e. |
org.springframework.messaging.converter.MessageConverter |
messageConverter() |
protected WampMessageSelector |
methodMessageHandlerMessageSelector() |
protected MethodParameterConverter |
methodParameterConverter() |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper()
Returns a Jackson's
ObjectMapper instance. |
protected org.springframework.util.PathMatcher |
pathMatcher()
Returns an instance of a
PathMatcher. |
protected void |
registerWampEndpoints(WampEndpointRegistry registry)
Register WAMP endpoints mapping each to a specific URL and (optionally) enabling
and configuring SockJS fallback options.
|
void |
setConfigurers(List<WampConfigurer> configurers) |
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
org.springframework.web.socket.WebSocketHandler |
subProtocolWebSocketHandler() |
SubscriptionRegistry |
subscriptionRegistry() |
org.springframework.web.servlet.HandlerMapping |
wampWebSocketHandlerMapping() |
static org.springframework.beans.factory.config.CustomScopeConfigurer |
webSocketScopeConfigurer(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
protected com.fasterxml.jackson.databind.ObjectMapper internalObjectMapper
protected org.springframework.util.PathMatcher internalPathMatcher
protected org.springframework.core.convert.ConversionService internalConversionService
@Autowired(required=false) public void setConfigurers(List<WampConfigurer> configurers)
@Autowired(required=false) public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
protected void registerWampEndpoints(WampEndpointRegistry registry)
@Bean public org.springframework.messaging.SubscribableChannel clientInboundChannel()
WampSubProtocolHandler,
brokerMessageHandler() and #annotationMethodMessageHandler()protected void configureClientInboundChannel(org.springframework.messaging.support.AbstractMessageChannel channel)
@Bean public Executor clientInboundChannelExecutor()
@Bean public org.springframework.messaging.SubscribableChannel clientOutboundChannel()
@Bean public org.springframework.messaging.converter.MessageConverter messageConverter()
@Bean public Executor clientOutboundChannelExecutor()
@Bean public org.springframework.messaging.SubscribableChannel brokerChannel()
brokerMessageHandler()public Executor brokerChannelExecutor()
brokerChannel(). By default messages send through the
brokerChannel are processed synchronously.@Bean public org.springframework.messaging.MessageHandler brokerMessageHandler()
@Bean public SubscriptionRegistry subscriptionRegistry()
protected WampMessageSelector brokerMessageHandlerMessageSelector()
@Bean public org.springframework.messaging.MessageHandler annotationMethodMessageHandler(org.springframework.context.ConfigurableApplicationContext configurableApplicationContext)
protected MethodParameterConverter methodParameterConverter()
protected WampMessageSelector methodMessageHandlerMessageSelector()
public void addArgumentResolvers(List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> argumentResolvers)
@Bean public EventMessenger eventMessenger()
protected org.springframework.util.PathMatcher pathMatcher()
PathMatcher. Used by the messageHandlers for
matching the topicURI to a destinationprotected com.fasterxml.jackson.databind.ObjectMapper objectMapper()
ObjectMapper instance. This mapper is used for
serializing and deserializing WAMP messages. When this method returns null the
library tries to find an ObjectMapper bean in the current spring context.
If no bean exists the library creates a new instance of ObjectMapper.public org.springframework.core.convert.ConversionService conversionService()
public AuthenticationSecretProvider authenticationSecretProvider()
AuthenticationSecretProvider for authentication.public AuthenticationHandler authenticationHandler()
AuthenticationHandler interface. When
authenticationSecretProvider() returns null this method returns null and
creates no AuthenticationHandlerpublic boolean authenticationRequired()
WampCallListener, WampPublishListener,
WampSubscribeListener or WampUnsubscribeListener) have to be
authenticated.@Bean public org.springframework.web.servlet.HandlerMapping wampWebSocketHandlerMapping()
@Bean public org.springframework.web.socket.WebSocketHandler subProtocolWebSocketHandler()
protected void addHandshakeInterceptors(List<org.springframework.web.socket.server.HandshakeInterceptor> handshakeInterceptors)
protected org.springframework.web.socket.WebSocketHandler decorateWebSocketHandler(org.springframework.web.socket.WebSocketHandler handler)
protected final WebSocketTransportRegistration getTransportRegistration()
public void configureWebSocketTransport(WebSocketTransportRegistration registration)
@Bean public org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler messageBrokerSockJsTaskScheduler()
SockJsServiceRegistration.setTaskScheduler(org.springframework.scheduling.TaskScheduler)
, i.e.
@Configuration
public class WampConfig extends DefaultWampConfiguration {
public void registerWampEndpoints(WampEndpointRegistry registry) {
registry.addEndpoint("/wamp").withSockJS().setTaskScheduler(myScheduler());
}
// ...
}
@Bean public static org.springframework.beans.factory.config.CustomScopeConfigurer webSocketScopeConfigurer(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
Copyright © 2014–2017. All rights reserved.