Browse Source

Consistent documentation references to Jakarta WebSocket (2.1)

Closes gh-29581
pull/29590/head
Juergen Hoeller 2 years ago
parent
commit
21d3a7529c
  1. 16
      framework-docs/src/docs/asciidoc/web/websocket.adoc
  2. 2
      spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerReadPublisher.java
  3. 4
      spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerWriteProcessor.java
  4. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/AbstractListenerWebSocketSession.java
  5. 6
      spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/StandardWebSocketHandlerAdapter.java
  6. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/StandardWebSocketClient.java
  7. 7
      spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/TomcatWebSocketClient.java
  8. 5
      spring-webflux/src/main/java/org/springframework/web/reactive/socket/server/RequestUpgradeStrategy.java
  9. 2
      spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/package-info.java
  10. 4
      spring-websocket/src/main/java/org/springframework/web/socket/client/standard/StandardWebSocketClient.java
  11. 2
      spring-websocket/src/main/java/org/springframework/web/socket/client/standard/package-info.java
  12. 3
      spring-websocket/src/main/java/org/springframework/web/socket/server/RequestUpgradeStrategy.java
  13. 2
      spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java
  14. 4
      spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointRegistration.java

16
framework-docs/src/docs/asciidoc/web/websocket.adoc

@ -184,7 +184,7 @@ HTTP requests. It is also easy to integrate into other HTTP processing scenarios @@ -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`"
@ -193,17 +193,9 @@ requests -- such as Spring MVC's `DispatcherServlet`. @@ -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

2
spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerReadPublisher.java

@ -38,7 +38,7 @@ import org.springframework.util.Assert; @@ -38,7 +38,7 @@ import org.springframework.util.Assert;
*
* <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

4
spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerWriteProcessor.java

@ -1,5 +1,5 @@ @@ -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.
@ -35,7 +35,7 @@ import org.springframework.util.StringUtils; @@ -35,7 +35,7 @@ import org.springframework.util.StringUtils;
*
* <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

2
spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/AbstractListenerWebSocketSession.java

@ -42,7 +42,7 @@ import org.springframework.web.reactive.socket.WebSocketSession; @@ -42,7 +42,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
/**
* 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

6
spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/StandardWebSocketHandlerAdapter.java

@ -1,5 +1,5 @@ @@ -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.
@ -36,8 +36,8 @@ import org.springframework.web.reactive.socket.WebSocketMessage.Type; @@ -36,8 +36,8 @@ import org.springframework.web.reactive.socket.WebSocketMessage.Type;
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

2
spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/StandardWebSocketClient.java

@ -43,7 +43,7 @@ import org.springframework.web.reactive.socket.adapter.StandardWebSocketHandlerA @@ -43,7 +43,7 @@ import org.springframework.web.reactive.socket.adapter.StandardWebSocketHandlerA
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

7
spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/TomcatWebSocketClient.java

@ -1,5 +1,5 @@ @@ -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.
@ -26,14 +26,15 @@ import org.springframework.web.reactive.socket.adapter.StandardWebSocketSession; @@ -26,14 +26,15 @@ import org.springframework.web.reactive.socket.adapter.StandardWebSocketSession;
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());
}

5
spring-webflux/src/main/java/org/springframework/web/reactive/socket/server/RequestUpgradeStrategy.java

@ -1,5 +1,5 @@ @@ -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.
@ -33,11 +33,12 @@ import org.springframework.web.server.ServerWebExchange; @@ -33,11 +33,12 @@ import org.springframework.web.server.ServerWebExchange;
*
* <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 {

2
spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/package-info.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/**
* Adapter classes for the standard Java WebSocket API.
* Adapter classes for the standard Jakarta WebSocket API.
*/
@NonNullApi
@NonNullFields

4
spring-websocket/src/main/java/org/springframework/web/socket/client/standard/StandardWebSocketClient.java

@ -51,7 +51,7 @@ import org.springframework.web.socket.adapter.standard.WebSocketToStandardExtens @@ -51,7 +51,7 @@ import org.springframework.web.socket.adapter.standard.WebSocketToStandardExtens
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
@ -88,7 +88,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { @@ -88,7 +88,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
/**
* 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.

2
spring-websocket/src/main/java/org/springframework/web/socket/client/standard/package-info.java

@ -1,5 +1,5 @@ @@ -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

3
spring-websocket/src/main/java/org/springframework/web/socket/server/RequestUpgradeStrategy.java

@ -1,5 +1,5 @@ @@ -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.
@ -31,6 +31,7 @@ import org.springframework.web.socket.WebSocketHandler; @@ -31,6 +31,7 @@ import org.springframework.web.socket.WebSocketHandler;
*
* @author Rossen Stoyanchev
* @since 4.0
* @see org.springframework.web.socket.server.standard.StandardWebSocketUpgradeStrategy
*/
public interface RequestUpgradeStrategy {

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

@ -37,7 +37,7 @@ import org.springframework.web.context.support.WebApplicationObjectSupport; @@ -37,7 +37,7 @@ import org.springframework.web.context.support.WebApplicationObjectSupport;
/**
* 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}.

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

@ -1,5 +1,5 @@ @@ -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.
@ -38,7 +38,7 @@ import org.springframework.web.socket.handler.BeanCreatingHandlerProvider; @@ -38,7 +38,7 @@ import org.springframework.web.socket.handler.BeanCreatingHandlerProvider;
/**
* 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

Loading…
Cancel
Save