diff --git a/docs/src/docs/asciidoc/guides/boot-websocket.adoc b/docs/src/docs/asciidoc/guides/boot-websocket.adoc index 6cd0a539..00904871 100644 --- a/docs/src/docs/asciidoc/guides/boot-websocket.adoc +++ b/docs/src/docs/asciidoc/guides/boot-websocket.adoc @@ -24,7 +24,7 @@ Please make sure you have already integrated Spring Session with the HttpSession [[websocket-spring-configuration]] == Spring Configuration -In a typical Spring WebSocket application users would extend `AbstractWebSocketMessageBrokerConfigurer`. +In a typical Spring WebSocket application users would implement `WebSocketMessageBrokerConfigurer`. For example, the configuration might look something like the following: [source,java] @@ -43,7 +43,7 @@ include::{samples-dir}boot/websocket/src/main/java/sample/config/WebSocketConfig To hook in the Spring Session support we only need to change two things: -<1> Instead of extending `AbstractWebSocketMessageBrokerConfigurer` we extend `AbstractSessionWebSocketMessageBrokerConfigurer` +<1> Instead of implementing `WebSocketMessageBrokerConfigurer` we extend `AbstractSessionWebSocketMessageBrokerConfigurer` <2> We rename the `registerStompEndpoints` method to `configureStompEndpoints` What does `AbstractSessionWebSocketMessageBrokerConfigurer` do behind the scenes? diff --git a/docs/src/test/java/docs/websocket/WebSocketConfig.java b/docs/src/test/java/docs/websocket/WebSocketConfig.java index ffff8db8..bd96a910 100644 --- a/docs/src/test/java/docs/websocket/WebSocketConfig.java +++ b/docs/src/test/java/docs/websocket/WebSocketConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,9 @@ package docs.websocket; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; +import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; /** * @author Rob Winch @@ -30,7 +30,7 @@ import org.springframework.web.socket.config.annotation.StompEndpointRegistry; @Configuration @EnableScheduling @EnableWebSocketMessageBroker -public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { +public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { @Override public void registerStompEndpoints(StompEndpointRegistry registry) { diff --git a/spring-session-core/src/main/java/org/springframework/session/web/socket/config/annotation/AbstractSessionWebSocketMessageBrokerConfigurer.java b/spring-session-core/src/main/java/org/springframework/session/web/socket/config/annotation/AbstractSessionWebSocketMessageBrokerConfigurer.java index 6fc45440..69a86b83 100644 --- a/spring-session-core/src/main/java/org/springframework/session/web/socket/config/annotation/AbstractSessionWebSocketMessageBrokerConfigurer.java +++ b/spring-session-core/src/main/java/org/springframework/session/web/socket/config/annotation/AbstractSessionWebSocketMessageBrokerConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 the original author or authors. + * Copyright 2014-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,10 +25,10 @@ import org.springframework.session.SessionRepository; import org.springframework.session.web.socket.handler.WebSocketConnectHandlerDecoratorFactory; import org.springframework.session.web.socket.handler.WebSocketRegistryListener; import org.springframework.session.web.socket.server.SessionRepositoryMessageInterceptor; -import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; import org.springframework.web.socket.config.annotation.StompWebSocketEndpointRegistration; import org.springframework.web.socket.config.annotation.WebMvcStompEndpointRegistry; +import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; import org.springframework.web.socket.config.annotation.WebSocketTransportRegistration; import org.springframework.web.socket.messaging.StompSubProtocolErrorHandler; import org.springframework.web.socket.server.HandshakeInterceptor; @@ -75,7 +75,7 @@ import org.springframework.web.util.UrlPathHelper; * @since 1.0 */ public abstract class AbstractSessionWebSocketMessageBrokerConfigurer - extends AbstractWebSocketMessageBrokerConfigurer { + implements WebSocketMessageBrokerConfigurer { @Autowired @SuppressWarnings("rawtypes")