Skip to content

Commit b15f404

Browse files
committed
Updated compatibility statements in RequestUpgradeStrategy javadocs
1 parent 357fab6 commit b15f404

File tree

8 files changed

+45
-41
lines changed

8 files changed

+45
-41
lines changed

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

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

5858
/**
59-
* {@link RequestUpgradeStrategy} for use with Jetty 9. Based on Jetty's internal
60-
* {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
59+
* A {@link RequestUpgradeStrategy} for use with Jetty 9.0-9.3. Based on Jetty's
60+
* internal {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
6161
*
6262
* @author Phillip Webb
6363
* @author Rossen Stoyanchev
@@ -83,17 +83,17 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy, Life
8383

8484

8585
/**
86-
* Default constructor that creates {@link WebSocketServerFactory} through its default
87-
* constructor thus using a default {@link WebSocketPolicy}.
86+
* Default constructor that creates {@link WebSocketServerFactory} through
87+
* its default constructor thus using a default {@link WebSocketPolicy}.
8888
*/
8989
public JettyRequestUpgradeStrategy() {
9090
this(new WebSocketServerFactory());
9191
}
9292

9393
/**
94-
* A constructor accepting a {@link WebSocketServerFactory}. This may be useful for
95-
* modifying the factory's {@link WebSocketPolicy} via
96-
* {@link WebSocketServerFactory#getPolicy()}.
94+
* A constructor accepting a {@link WebSocketServerFactory}.
95+
* This may be useful for modifying the factory's {@link WebSocketPolicy}
96+
* via {@link WebSocketServerFactory#getPolicy()}.
9797
*/
9898
public JettyRequestUpgradeStrategy(WebSocketServerFactory factory) {
9999
Assert.notNull(factory, "WebSocketServerFactory must not be null");
@@ -199,7 +199,7 @@ public void upgrade(ServerHttpRequest request, ServerHttpResponse response,
199199
}
200200
catch (IOException ex) {
201201
throw new HandshakeFailureException(
202-
"Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
202+
"Response update failed during upgrade to WebSocket: " + request.getURI(), ex);
203203
}
204204
finally {
205205
wsContainerHolder.remove();

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -59,8 +59,8 @@
5959
import org.springframework.web.socket.server.HandshakeFailureException;
6060

6161
/**
62-
* A {@link org.springframework.web.socket.server.RequestUpgradeStrategy} for use
63-
* with WildFly and its underlying Undertow web server.
62+
* A WebSocket {@code RequestUpgradeStrategy} for use with WildFly and its
63+
* underlying Undertow web server. Also compatible with embedded Undertow usage.
6464
*
6565
* <p>Compatible with Undertow 1.0 to 1.3 - as included in WildFly 8.x, 9 and 10.
6666
*

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/AbstractHandshakeHandler.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,26 @@
4646
import org.springframework.web.socket.server.RequestUpgradeStrategy;
4747

4848
/**
49-
* A base class to use for {@link HandshakeHandler} implementations.
50-
* Performs initial validation of the WebSocket handshake request -- possibly rejecting it
51-
* through the appropriate HTTP status code -- while also allowing sub-classes to override
49+
* A base class for {@link HandshakeHandler} implementations, independent from the Servlet API.
50+
*
51+
* <p>Performs initial validation of the WebSocket handshake request - possibly rejecting it
52+
* through the appropriate HTTP status code - while also allowing its subclasses to override
5253
* various parts of the negotiation process (e.g. origin validation, sub-protocol negotiation,
5354
* extensions negotiation, etc).
5455
*
5556
* <p>If the negotiation succeeds, the actual upgrade is delegated to a server-specific
56-
* {@link RequestUpgradeStrategy}, which will update
57+
* {@link org.springframework.web.socket.server.RequestUpgradeStrategy}, which will update
5758
* the response as necessary and initialize the WebSocket. Currently supported servers are
58-
* Tomcat 7 and 8, Jetty 9, and GlassFish 4.
59+
* Jetty 9.0-9.3, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.3, GlassFish 4.1+, WebLogic 12.1.3+.
5960
*
6061
* @author Rossen Stoyanchev
61-
* @since 4.0
62+
* @author Juergen Hoeller
63+
* @since 4.2
64+
* @see org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy
65+
* @see org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy
66+
* @see org.springframework.web.socket.server.standard.UndertowRequestUpgradeStrategy
67+
* @see org.springframework.web.socket.server.standard.GlassFishRequestUpgradeStrategy
68+
* @see org.springframework.web.socket.server.standard.WebLogicRequestUpgradeStrategy
6269
*/
6370
public abstract class AbstractHandshakeHandler implements HandshakeHandler, Lifecycle {
6471

@@ -137,6 +144,7 @@ else if (websphereWsPresent) {
137144
else {
138145
throw new IllegalStateException("No suitable default RequestUpgradeStrategy found");
139146
}
147+
140148
try {
141149
Class<?> clazz = ClassUtils.forName(className, classLoader);
142150
return (RequestUpgradeStrategy) clazz.newInstance();
@@ -258,7 +266,7 @@ public final boolean doHandshake(ServerHttpRequest request, ServerHttpResponse r
258266
}
259267
catch (IOException ex) {
260268
throw new HandshakeFailureException(
261-
"Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
269+
"Response update failed during upgrade to WebSocket: " + request.getURI(), ex);
262270
}
263271

264272
String subProtocol = selectProtocol(headers.getSecWebSocketProtocol(), wsHandler);
@@ -392,8 +400,7 @@ protected List<WebSocketExtension> filterRequestedExtensions(ServerHttpRequest r
392400
* in the process of being established. The default implementation calls
393401
* {@link ServerHttpRequest#getPrincipal()}
394402
* <p>Subclasses can provide custom logic for associating a user with a session,
395-
* for example for assigning a name to anonymous users (i.e. not fully
396-
* authenticated).
403+
* for example for assigning a name to anonymous users (i.e. not fully authenticated).
397404
* @param request the handshake request
398405
* @param wsHandler the WebSocket handler that will handle messages
399406
* @param attributes handshake attributes to pass to the WebSocket session

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@
2222
import org.springframework.web.socket.server.RequestUpgradeStrategy;
2323

2424
/**
25-
* A default {@link org.springframework.web.socket.server.HandshakeHandler} implementation.
26-
* Performs initial validation of the WebSocket handshake request -- possibly rejecting it
27-
* through the appropriate HTTP status code -- while also allowing sub-classes to override
28-
* various parts of the negotiation process (e.g. origin validation, sub-protocol negotiation,
29-
* extensions negotiation, etc).
30-
*
31-
* <p>If the negotiation succeeds, the actual upgrade is delegated to a server-specific
32-
* {@link org.springframework.web.socket.server.RequestUpgradeStrategy}, which will update
33-
* the response as necessary and initialize the WebSocket. Currently supported servers are
34-
* Tomcat 7 and 8, Jetty 9, and GlassFish 4.
25+
* A default {@link org.springframework.web.socket.server.HandshakeHandler} implementation,
26+
* extending {@link AbstractHandshakeHandler} with Servlet-specific initialization support.
27+
* See {@link AbstractHandshakeHandler}'s javadoc for details on supported servers etc.
3528
*
3629
* @author Rossen Stoyanchev
30+
* @author Juergen Hoeller
3731
* @since 4.0
3832
*/
3933
public class DefaultHandshakeHandler extends AbstractHandshakeHandler implements ServletContextAware {

0 commit comments

Comments
 (0)