Skip to content

Commit

Permalink
Consistent documentation references to Jakarta WebSocket (2.1)
Browse files Browse the repository at this point in the history
Closes gh-29581
  • Loading branch information
jhoeller committed Nov 25, 2022
1 parent 9c7b471 commit 21d3a75
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 33 deletions.
16 changes: 4 additions & 12 deletions framework-docs/src/docs/asciidoc/web/websocket.adoc
Expand Up @@ -184,7 +184,7 @@ HTTP requests. It is also easy to integrate into other HTTP processing scenarios
by invoking `WebSocketHttpRequestHandler`. This is convenient and easy to
understand. However, special considerations apply with regards to JSR-356 runtimes.

The Java WebSocket API (JSR-356) provides two deployment mechanisms. The first
The Jakarta WebSocket API (JSR-356) provides two deployment mechanisms. The first
involves a Servlet container classpath scan (a Servlet 3 feature) at startup.
The other is a registration API to use at Servlet container initialization.
Neither of these mechanism makes it possible to use a single "`front controller`"
Expand All @@ -193,17 +193,9 @@ requests -- such as Spring MVC's `DispatcherServlet`.

This is a significant limitation of JSR-356 that Spring's WebSocket support addresses with
server-specific `RequestUpgradeStrategy` implementations even when running in a JSR-356 runtime.
Such strategies currently exist for Tomcat, Jetty, GlassFish, WebLogic, WebSphere, and
Undertow (and WildFly).



NOTE: A request to overcome the preceding limitation in the Java WebSocket API has been
created and can be followed at
https://github.com/eclipse-ee4j/websocket-api/issues/211[eclipse-ee4j/websocket-api#211].
Tomcat, Undertow, and WebSphere provide their own API alternatives that
make it possible to do this, and it is also possible with Jetty. We are hopeful
that more servers will do the same.
Such strategies currently exist for Tomcat, Jetty, GlassFish, WebLogic, WebSphere, and Undertow
(and WildFly). As of Jakarta WebSocket 2.1, a standard request upgrade strategy is available
which Spring chooses on Jakarta EE 10 based web containers such as Tomcat 10.1 and Jetty 12.

A secondary consideration is that Servlet containers with JSR-356 support are expected
to perform a `ServletContainerInitializer` (SCI) scan that can slow down application
Expand Down
Expand Up @@ -38,7 +38,7 @@
*
* <p>Specifically a base class for reading from the HTTP request body with
* Servlet non-blocking I/O and Undertow XNIO as well as handling incoming
* WebSocket messages with standard Java WebSocket (JSR-356), Jetty, and
* WebSocket messages with standard Jakarta WebSocket (JSR-356), Jetty, and
* Undertow.
*
* @author Arjen Poutsma
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
Expand Down Expand Up @@ -35,7 +35,7 @@
*
* <p>Specifically a base class for writing to the HTTP response body with
* Servlet non-blocking I/O and Undertow XNIO as well for writing WebSocket
* messages through the Java WebSocket API (JSR-356), Jetty, and Undertow.
* messages through the Jakarta WebSocket API (JSR-356), Jetty, and Undertow.
*
* @author Arjen Poutsma
* @author Violeta Georgieva
Expand Down
Expand Up @@ -42,7 +42,7 @@

/**
* Base class for {@link WebSocketSession} implementations that bridge between
* event-listener WebSocket APIs (e.g. Java WebSocket API JSR-356, Jetty,
* event-listener WebSocket APIs (e.g. Jakarta WebSocket API (JSR-356), Jetty,
* Undertow) and Reactive Streams.
*
* <p>Also implements {@code Subscriber<Void>} so it can be used to subscribe to
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
Expand Down Expand Up @@ -36,8 +36,8 @@
import org.springframework.web.reactive.socket.WebSocketSession;

/**
* Adapter for Java WebSocket API (JSR-356) that delegates events to a reactive
* {@link WebSocketHandler} and its session.
* Adapter for the Jakarta WebSocket API (JSR-356) that delegates events to a
* reactive {@link WebSocketHandler} and its session.
*
* @author Violeta Georgieva
* @author Rossen Stoyanchev
Expand Down
Expand Up @@ -43,7 +43,7 @@
import org.springframework.web.reactive.socket.adapter.StandardWebSocketSession;

/**
* {@link WebSocketClient} implementation for use with the Java WebSocket API.
* {@link WebSocketClient} implementation for use with the Jakarta WebSocket API.
*
* @author Violeta Georgieva
* @author Rossen Stoyanchev
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 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.
Expand All @@ -26,14 +26,15 @@
import org.springframework.web.reactive.socket.adapter.TomcatWebSocketSession;

/**
* {@link WebSocketClient} implementation for use with the Java WebSocket API.
* {@link WebSocketClient} implementation for use with Tomcat,
* based on the Jakarta WebSocket API.
*
* @author Violeta Georgieva
* @since 5.0
* @see StandardWebSocketClient
*/
public class TomcatWebSocketClient extends StandardWebSocketClient {


public TomcatWebSocketClient() {
this(new WsWebSocketContainer());
}
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
Expand Down Expand Up @@ -33,11 +33,12 @@
*
* <p>Typically there is one such strategy for every {@link ServerHttpRequest}
* and {@link ServerHttpResponse} type except in the case of Servlet containers
* for which the standard Java WebSocket API JSR-356 does not define a way to
* for which the standard Jakarta WebSocket API (JSR-356) does not define a way to
* upgrade a request so a custom strategy is needed for every Servlet container.
*
* @author Rossen Stoyanchev
* @since 5.0
* @see org.springframework.web.reactive.socket.server.upgrade.StandardWebSocketUpgradeStrategy
*/
public interface RequestUpgradeStrategy {

Expand Down
@@ -1,5 +1,5 @@
/**
* Adapter classes for the standard Java WebSocket API.
* Adapter classes for the standard Jakarta WebSocket API.
*/
@NonNullApi
@NonNullFields
Expand Down
Expand Up @@ -51,7 +51,7 @@
import org.springframework.web.socket.client.AbstractWebSocketClient;

/**
* A WebSocketClient based on standard Java WebSocket API.
* A WebSocketClient based on the standard Jakarta WebSocket API.
*
* @author Rossen Stoyanchev
* @since 4.0
Expand Down Expand Up @@ -88,7 +88,7 @@ public StandardWebSocketClient(WebSocketContainer webSocketContainer) {


/**
* The standard Java WebSocket API allows passing "user properties" to the
* The standard Jakarta WebSocket API allows passing "user properties" to the
* server via {@link ClientEndpointConfig#getUserProperties() userProperties}.
* Use this property to configure one or more properties to be passed on
* every handshake.
Expand Down
@@ -1,5 +1,5 @@
/**
* Client-side classes for use with standard Java WebSocket endpoints.
* Client-side classes for use with standard Jakarta WebSocket endpoints.
*/
@NonNullApi
@NonNullFields
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2022 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.
Expand Down Expand Up @@ -31,6 +31,7 @@
*
* @author Rossen Stoyanchev
* @since 4.0
* @see org.springframework.web.socket.server.standard.StandardWebSocketUpgradeStrategy
*/
public interface RequestUpgradeStrategy {

Expand Down
Expand Up @@ -37,7 +37,7 @@

/**
* Detects beans of type {@link jakarta.websocket.server.ServerEndpointConfig} and registers
* with the standard Java WebSocket runtime. Also detects beans annotated with
* with the standard Jakarta WebSocket runtime. Also detects beans annotated with
* {@link ServerEndpoint} and registers them as well. Although not required, it is likely
* annotated endpoints should have their {@code configurator} property set to
* {@link SpringConfigurator}.
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2022 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.
Expand Down Expand Up @@ -38,7 +38,7 @@
/**
* An implementation of {@link jakarta.websocket.server.ServerEndpointConfig} for use in
* Spring-based applications. A {@link ServerEndpointRegistration} bean is detected by
* {@link ServerEndpointExporter} and registered with a Java WebSocket runtime at startup.
* {@link ServerEndpointExporter} and registered with a Jakarta WebSocket runtime at startup.
*
* <p>Class constructors accept a singleton {@link jakarta.websocket.Endpoint} instance
* or an Endpoint specified by type {@link Class}. When specified by type, the endpoint
Expand Down

0 comments on commit 21d3a75

Please sign in to comment.