Skip to content

Commit c0b6d32

Browse files
committed
Updated compatibility statements in RequestUpgradeStrategy javadocs
1 parent d7a4183 commit c0b6d32

File tree

7 files changed

+38
-29
lines changed

7 files changed

+38
-29
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/server/jetty/JettyRequestUpgradeStrategy.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,8 +50,8 @@
5050
import org.springframework.web.socket.server.RequestUpgradeStrategy;
5151

5252
/**
53-
* {@link RequestUpgradeStrategy} for use with Jetty 9. Based on Jetty's internal
54-
* {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
53+
* A {@link RequestUpgradeStrategy} for use with Jetty 9.x. Based on Jetty's
54+
* internal {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
5555
*
5656
* @author Phillip Webb
5757
* @author Rossen Stoyanchev
@@ -69,17 +69,17 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy {
6969

7070

7171
/**
72-
* Default constructor that creates {@link WebSocketServerFactory} through its default
73-
* constructor thus using a default {@link WebSocketPolicy}.
72+
* Default constructor that creates {@link WebSocketServerFactory} through
73+
* its default constructor thus using a default {@link WebSocketPolicy}.
7474
*/
7575
public JettyRequestUpgradeStrategy() {
7676
this(new WebSocketServerFactory());
7777
}
7878

7979
/**
80-
* A constructor accepting a {@link WebSocketServerFactory}. This may be useful for
81-
* modifying the factory's {@link WebSocketPolicy} via
82-
* {@link WebSocketServerFactory#getPolicy()}.
80+
* A constructor accepting a {@link WebSocketServerFactory}.
81+
* This may be useful for modifying the factory's {@link WebSocketPolicy}
82+
* via {@link WebSocketServerFactory#getPolicy()}.
8383
*/
8484
public JettyRequestUpgradeStrategy(WebSocketServerFactory factory) {
8585
Assert.notNull(factory, "WebSocketServerFactory must not be null");
@@ -154,7 +154,7 @@ public void upgrade(ServerHttpRequest request, ServerHttpResponse response,
154154
}
155155
catch (IOException ex) {
156156
throw new HandshakeFailureException(
157-
"Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
157+
"Response update failed during upgrade to WebSocket: " + request.getURI(), ex);
158158
}
159159
finally {
160160
wsContainerHolder.remove();

spring-websocket/src/main/java/org/springframework/web/socket/server/standard/AbstractTyrusRequestUpgradeStrategy.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,9 +54,10 @@
5454
import org.springframework.web.socket.server.HandshakeFailureException;
5555

5656
/**
57-
* An base class for WebSocket servers using Tyrus.
57+
* A base class for {@code RequestUpgradeStrategy} implementations on top of
58+
* JSR-356 based servers which include Tyrus as their WebSocket engine.
5859
*
59-
* <p>Works with Tyrus 1.3.5 (WebLogic 12.1.3) and Tyrus 1.7 (GlassFish 4.0.1).
60+
* <p>Works with Tyrus 1.3.5 (WebLogic 12.1.3) and Tyrus 1.7+ (GlassFish 4.1.x).
6061
*
6162
* @author Rossen Stoyanchev
6263
* @since 4.1

spring-websocket/src/main/java/org/springframework/web/socket/server/standard/GlassFishRequestUpgradeStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
3434
import org.springframework.web.socket.server.HandshakeFailureException;
3535

3636
/**
37-
* A WebSocket {@code RequestUpgradeStrategy} for GlassFish 4.0.1 and beyond.
37+
* A WebSocket {@code RequestUpgradeStrategy} for Oracle's GlassFish 4.1 and higher.
3838
*
3939
* @author Rossen Stoyanchev
4040
* @author Juergen Hoeller

spring-websocket/src/main/java/org/springframework/web/socket/server/standard/TomcatRequestUpgradeStrategy.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,8 +34,10 @@
3434
import org.springframework.web.socket.server.HandshakeFailureException;
3535

3636
/**
37-
* Tomcat support for upgrading an {@link HttpServletRequest} during a WebSocket handshake.
38-
* To modify properties of the underlying {@link javax.websocket.server.ServerContainer}
37+
* A WebSocket {@code RequestUpgradeStrategy} for Apache Tomcat. Compatible with
38+
* all versions of Tomcat that support JSR-356, i.e. Tomcat 7.0.47+ and higher.
39+
*
40+
* <p>To modify properties of the underlying {@link javax.websocket.server.ServerContainer}
3941
* you can use {@link ServletServerContainerFactoryBean} in XML configuration or,
4042
* when using Java configuration, access the container instance through the
4143
* "javax.websocket.server.ServerContainer" ServletContext attribute.
@@ -59,7 +61,7 @@ public void upgradeInternal(ServerHttpRequest request, ServerHttpResponse respon
5961
HttpServletResponse servletResponse = getHttpServletResponse(response);
6062

6163
StringBuffer requestUrl = servletRequest.getRequestURL();
62-
String path = servletRequest.getRequestURI(); // shouldn't matter
64+
String path = servletRequest.getRequestURI(); // shouldn't matter
6365
Map<String, String> pathParams = Collections.<String, String> emptyMap();
6466

6567
ServerEndpointRegistration endpointConfig = new ServerEndpointRegistration(path, endpoint);
@@ -71,11 +73,11 @@ public void upgradeInternal(ServerHttpRequest request, ServerHttpResponse respon
7173
}
7274
catch (ServletException ex) {
7375
throw new HandshakeFailureException(
74-
"Servlet request failed to upgrade to WebSocket, uri=" + requestUrl, ex);
76+
"Servlet request failed to upgrade to WebSocket: " + requestUrl, ex);
7577
}
7678
catch (IOException ex) {
7779
throw new HandshakeFailureException(
78-
"Response update failed during upgrade to WebSocket, uri=" + requestUrl, ex);
80+
"Response update failed during upgrade to WebSocket: " + requestUrl, ex);
7981
}
8082
}
8183

spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
import org.springframework.web.socket.server.HandshakeFailureException;
5757

5858
/**
59-
* A {@link org.springframework.web.socket.server.RequestUpgradeStrategy} for use
60-
* with WildFly and its underlying Undertow web server.
59+
* A WebSocket {@code RequestUpgradeStrategy} for use with WildFly and its
60+
* underlying Undertow web server. Also compatible with embedded Undertow usage.
6161
*
6262
* <p>Compatible with Undertow 1.0, 1.1, 1.2 - as included in WildFly 8.x and 9.0.
6363
*

spring-websocket/src/main/java/org/springframework/web/socket/server/standard/WebLogicRequestUpgradeStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@
4242
import org.springframework.web.socket.server.HandshakeFailureException;
4343

4444
/**
45-
* A WebSocket {@code RequestUpgradeStrategy} for WebLogic 12.1.3.
45+
* A WebSocket {@code RequestUpgradeStrategy} for Oracle's WebLogic 12.1.3 and higher.
4646
*
4747
* @author Rossen Stoyanchev
4848
* @since 4.1

spring-websocket/src/main/java/org/springframework/web/socket/server/support/DefaultHandshakeHandler.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,10 +54,16 @@
5454
* <p>If the negotiation succeeds, the actual upgrade is delegated to a server-specific
5555
* {@link org.springframework.web.socket.server.RequestUpgradeStrategy}, which will update
5656
* the response as necessary and initialize the WebSocket. Currently supported servers are
57-
* Tomcat 7 and 8, Jetty 9, and GlassFish 4.
57+
* Jetty 9.x, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.2, GlassFish 4.1+, WebLogic 12.1.3+.
5858
*
5959
* @author Rossen Stoyanchev
60+
* @author Juergen Hoeller
6061
* @since 4.0
62+
* @see org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy
63+
* @see org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy
64+
* @see org.springframework.web.socket.server.standard.UndertowRequestUpgradeStrategy
65+
* @see org.springframework.web.socket.server.standard.GlassFishRequestUpgradeStrategy
66+
* @see org.springframework.web.socket.server.standard.WebLogicRequestUpgradeStrategy
6167
*/
6268
public class DefaultHandshakeHandler implements HandshakeHandler {
6369

@@ -126,6 +132,7 @@ else if (webLogicWsPresent) {
126132
else {
127133
throw new IllegalStateException("No suitable default RequestUpgradeStrategy found");
128134
}
135+
129136
try {
130137
Class<?> clazz = ClassUtils.forName(className, DefaultHandshakeHandler.class.getClassLoader());
131138
return (RequestUpgradeStrategy) clazz.newInstance();
@@ -206,7 +213,7 @@ public final boolean doHandshake(ServerHttpRequest request, ServerHttpResponse r
206213
}
207214
catch (IOException ex) {
208215
throw new HandshakeFailureException(
209-
"Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
216+
"Response update failed during upgrade to WebSocket: " + request.getURI(), ex);
210217
}
211218

212219
String subProtocol = selectProtocol(headers.getSecWebSocketProtocol(), wsHandler);
@@ -340,8 +347,7 @@ protected List<WebSocketExtension> filterRequestedExtensions(ServerHttpRequest r
340347
* in the process of being established. The default implementation calls
341348
* {@link org.springframework.http.server.ServerHttpRequest#getPrincipal()}
342349
* <p>Subclasses can provide custom logic for associating a user with a session,
343-
* for example for assigning a name to anonymous users (i.e. not fully
344-
* authenticated).
350+
* for example for assigning a name to anonymous users (i.e. not fully authenticated).
345351
* @param request the handshake request
346352
* @param wsHandler the WebSocket handler that will handle messages
347353
* @param attributes handshake attributes to pass to the WebSocket session

0 commit comments

Comments
 (0)