Updated compatibility statements in RequestUpgradeStrategy javadocs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -50,8 +50,8 @@ import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
import org.springframework.web.socket.server.RequestUpgradeStrategy;
|
||||
|
||||
/**
|
||||
* {@link RequestUpgradeStrategy} for use with Jetty 9. Based on Jetty's internal
|
||||
* {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
|
||||
* A {@link RequestUpgradeStrategy} for use with Jetty 9.x. Based on Jetty's
|
||||
* internal {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Rossen Stoyanchev
|
||||
@@ -69,17 +69,17 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy {
|
||||
|
||||
|
||||
/**
|
||||
* Default constructor that creates {@link WebSocketServerFactory} through its default
|
||||
* constructor thus using a default {@link WebSocketPolicy}.
|
||||
* Default constructor that creates {@link WebSocketServerFactory} through
|
||||
* its default constructor thus using a default {@link WebSocketPolicy}.
|
||||
*/
|
||||
public JettyRequestUpgradeStrategy() {
|
||||
this(new WebSocketServerFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* A constructor accepting a {@link WebSocketServerFactory}. This may be useful for
|
||||
* modifying the factory's {@link WebSocketPolicy} via
|
||||
* {@link WebSocketServerFactory#getPolicy()}.
|
||||
* A constructor accepting a {@link WebSocketServerFactory}.
|
||||
* This may be useful for modifying the factory's {@link WebSocketPolicy}
|
||||
* via {@link WebSocketServerFactory#getPolicy()}.
|
||||
*/
|
||||
public JettyRequestUpgradeStrategy(WebSocketServerFactory factory) {
|
||||
Assert.notNull(factory, "WebSocketServerFactory must not be null");
|
||||
@@ -154,7 +154,7 @@ public class JettyRequestUpgradeStrategy implements RequestUpgradeStrategy {
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new HandshakeFailureException(
|
||||
"Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
|
||||
"Response update failed during upgrade to WebSocket: " + request.getURI(), ex);
|
||||
}
|
||||
finally {
|
||||
wsContainerHolder.remove();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -54,9 +54,10 @@ import org.springframework.web.socket.WebSocketExtension;
|
||||
import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
|
||||
/**
|
||||
* An base class for WebSocket servers using Tyrus.
|
||||
* A base class for {@code RequestUpgradeStrategy} implementations on top of
|
||||
* JSR-356 based servers which include Tyrus as their WebSocket engine.
|
||||
*
|
||||
* <p>Works with Tyrus 1.3.5 (WebLogic 12.1.3) and Tyrus 1.7 (GlassFish 4.0.1).
|
||||
* <p>Works with Tyrus 1.3.5 (WebLogic 12.1.3) and Tyrus 1.7+ (GlassFish 4.1.x).
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -34,7 +34,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
|
||||
/**
|
||||
* A WebSocket {@code RequestUpgradeStrategy} for GlassFish 4.0.1 and beyond.
|
||||
* A WebSocket {@code RequestUpgradeStrategy} for Oracle's GlassFish 4.1 and higher.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -34,8 +34,10 @@ import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
|
||||
/**
|
||||
* Tomcat support for upgrading an {@link HttpServletRequest} during a WebSocket handshake.
|
||||
* To modify properties of the underlying {@link javax.websocket.server.ServerContainer}
|
||||
* A WebSocket {@code RequestUpgradeStrategy} for Apache Tomcat. Compatible with
|
||||
* all versions of Tomcat that support JSR-356, i.e. Tomcat 7.0.47+ and higher.
|
||||
*
|
||||
* <p>To modify properties of the underlying {@link javax.websocket.server.ServerContainer}
|
||||
* you can use {@link ServletServerContainerFactoryBean} in XML configuration or,
|
||||
* when using Java configuration, access the container instance through the
|
||||
* "javax.websocket.server.ServerContainer" ServletContext attribute.
|
||||
@@ -59,7 +61,7 @@ public class TomcatRequestUpgradeStrategy extends AbstractStandardUpgradeStrateg
|
||||
HttpServletResponse servletResponse = getHttpServletResponse(response);
|
||||
|
||||
StringBuffer requestUrl = servletRequest.getRequestURL();
|
||||
String path = servletRequest.getRequestURI(); // shouldn't matter
|
||||
String path = servletRequest.getRequestURI(); // shouldn't matter
|
||||
Map<String, String> pathParams = Collections.<String, String> emptyMap();
|
||||
|
||||
ServerEndpointRegistration endpointConfig = new ServerEndpointRegistration(path, endpoint);
|
||||
@@ -71,11 +73,11 @@ public class TomcatRequestUpgradeStrategy extends AbstractStandardUpgradeStrateg
|
||||
}
|
||||
catch (ServletException ex) {
|
||||
throw new HandshakeFailureException(
|
||||
"Servlet request failed to upgrade to WebSocket, uri=" + requestUrl, ex);
|
||||
"Servlet request failed to upgrade to WebSocket: " + requestUrl, ex);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new HandshakeFailureException(
|
||||
"Response update failed during upgrade to WebSocket, uri=" + requestUrl, ex);
|
||||
"Response update failed during upgrade to WebSocket: " + requestUrl, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
|
||||
/**
|
||||
* A {@link org.springframework.web.socket.server.RequestUpgradeStrategy} for use
|
||||
* with WildFly and its underlying Undertow web server.
|
||||
* A WebSocket {@code RequestUpgradeStrategy} for use with WildFly and its
|
||||
* underlying Undertow web server. Also compatible with embedded Undertow usage.
|
||||
*
|
||||
* <p>Compatible with Undertow 1.0, 1.1, 1.2 - as included in WildFly 8.x and 9.0.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -42,7 +42,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
|
||||
/**
|
||||
* A WebSocket {@code RequestUpgradeStrategy} for WebLogic 12.1.3.
|
||||
* A WebSocket {@code RequestUpgradeStrategy} for Oracle's WebLogic 12.1.3 and higher.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -54,10 +54,16 @@ import org.springframework.web.socket.server.RequestUpgradeStrategy;
|
||||
* <p>If the negotiation succeeds, the actual upgrade is delegated to a server-specific
|
||||
* {@link org.springframework.web.socket.server.RequestUpgradeStrategy}, which will update
|
||||
* the response as necessary and initialize the WebSocket. Currently supported servers are
|
||||
* Tomcat 7 and 8, Jetty 9, and GlassFish 4.
|
||||
* Jetty 9.x, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.2, GlassFish 4.1+, WebLogic 12.1.3+.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.0
|
||||
* @see org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy
|
||||
* @see org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy
|
||||
* @see org.springframework.web.socket.server.standard.UndertowRequestUpgradeStrategy
|
||||
* @see org.springframework.web.socket.server.standard.GlassFishRequestUpgradeStrategy
|
||||
* @see org.springframework.web.socket.server.standard.WebLogicRequestUpgradeStrategy
|
||||
*/
|
||||
public class DefaultHandshakeHandler implements HandshakeHandler {
|
||||
|
||||
@@ -126,6 +132,7 @@ public class DefaultHandshakeHandler implements HandshakeHandler {
|
||||
else {
|
||||
throw new IllegalStateException("No suitable default RequestUpgradeStrategy found");
|
||||
}
|
||||
|
||||
try {
|
||||
Class<?> clazz = ClassUtils.forName(className, DefaultHandshakeHandler.class.getClassLoader());
|
||||
return (RequestUpgradeStrategy) clazz.newInstance();
|
||||
@@ -206,7 +213,7 @@ public class DefaultHandshakeHandler implements HandshakeHandler {
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new HandshakeFailureException(
|
||||
"Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex);
|
||||
"Response update failed during upgrade to WebSocket: " + request.getURI(), ex);
|
||||
}
|
||||
|
||||
String subProtocol = selectProtocol(headers.getSecWebSocketProtocol(), wsHandler);
|
||||
@@ -340,8 +347,7 @@ public class DefaultHandshakeHandler implements HandshakeHandler {
|
||||
* in the process of being established. The default implementation calls
|
||||
* {@link org.springframework.http.server.ServerHttpRequest#getPrincipal()}
|
||||
* <p>Subclasses can provide custom logic for associating a user with a session,
|
||||
* for example for assigning a name to anonymous users (i.e. not fully
|
||||
* authenticated).
|
||||
* for example for assigning a name to anonymous users (i.e. not fully authenticated).
|
||||
* @param request the handshake request
|
||||
* @param wsHandler the WebSocket handler that will handle messages
|
||||
* @param attributes handshake attributes to pass to the WebSocket session
|
||||
|
||||
Reference in New Issue
Block a user