Fix and improve Javadoc in spring-websocket

Closes gh-28788
This commit is contained in:
Marc Wrobel 2022-07-11 19:22:48 +02:00 committed by Sam Brannen
parent d274e893a6
commit 03f0c57704
25 changed files with 60 additions and 60 deletions

View File

@ -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.
@ -139,7 +139,7 @@ public final class CloseStatus implements Serializable {
public static final CloseStatus TLS_HANDSHAKE_FAILURE = new CloseStatus(1015);
/**
* A status code for use within the framework the indicate a session has
* A status code for use within the framework that indicates a session has
* become unreliable (e.g. timed out while sending a message) and extra
* care should be exercised, e.g. avoid sending any further data to the
* client that may be done during normal shutdown.

View File

@ -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.
@ -83,7 +83,7 @@ public class WebSocketExtension {
/**
* Return the name of the extension (never {@code null) or empty}.
* Return the name of the extension (never {@code null} or empty).
*/
public String getName() {
return this.name;

View File

@ -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.
@ -121,7 +121,7 @@ public interface WebSocketSession extends Closeable {
/**
* Send a WebSocket message: either {@link TextMessage} or {@link BinaryMessage}.
* <p><strong>Note:</strong> The underlying standard WebSocket session (JSR-356) does
* not allow concurrent sending. Therefore sending must be synchronized. To ensure
* not allow concurrent sending. Therefore, sending must be synchronized. To ensure
* that, one option is to wrap the {@code WebSocketSession} with the
* {@link org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
* ConcurrentWebSocketSessionDecorator}.

View File

@ -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.
@ -95,7 +95,7 @@ public class JettyWebSocketSession extends AbstractWebSocketSession<Session> {
* Create a new {@link JettyWebSocketSession} instance associated with the given user.
* @param attributes the attributes from the HTTP handshake to associate with the WebSocket
* session; the provided attributes are copied, the original map is not used.
* @param user the user associated with the session; if {@code null} we'll fallback on the
* @param user the user associated with the session; if {@code null} we'll fall back on the
* user available via {@link org.eclipse.jetty.websocket.api.Session#getUpgradeRequest()}
*/
public JettyWebSocketSession(Map<String, Object> attributes, @Nullable Principal user) {

View File

@ -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.
@ -101,7 +101,7 @@ public abstract class ConvertingEncoderDecoderSupport<T, M> {
}
/**
* Strategy method used to obtain the {@link ConversionService}. By default this
* Strategy method used to obtain the {@link ConversionService}. By default, this
* method expects a bean named {@code 'webSocketConversionService'} in the
* {@link #getApplicationContext() active ApplicationContext}.
* @return the {@link ConversionService} (never null)
@ -119,7 +119,7 @@ public abstract class ConvertingEncoderDecoderSupport<T, M> {
}
/**
* Returns the active {@link ApplicationContext}. Be default this method obtains
* Returns the active {@link ApplicationContext}. By default, this method obtains
* the context via {@link ContextLoader#getCurrentWebApplicationContext()}, which
* finds the ApplicationContext loaded via {@link ContextLoader} typically in a
* Servlet container environment. When not running in a Servlet container and
@ -132,7 +132,7 @@ public abstract class ConvertingEncoderDecoderSupport<T, M> {
}
/**
* Returns the type being converted. By default the type is resolved using
* Returns the type being converted. By default, the type is resolved using
* the generic arguments of the class.
*/
protected TypeDescriptor getType() {
@ -140,7 +140,7 @@ public abstract class ConvertingEncoderDecoderSupport<T, M> {
}
/**
* Returns the websocket message type. By default the type is resolved using
* Returns the websocket message type. By default, the type is resolved using
* the generic arguments of the class.
*/
protected TypeDescriptor getMessageType() {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 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,8 +26,8 @@ import org.springframework.util.LinkedCaseInsensitiveMap;
import org.springframework.web.socket.WebSocketExtension;
/**
* A sub-class of {@link org.springframework.web.socket.WebSocketExtension} that
* can be constructed from an {@link javax.websocket.Extension}.
* A subclass of {@link org.springframework.web.socket.WebSocketExtension} that
* can be constructed from a {@link javax.websocket.Extension}.
*
* @author Rossen Stoyanchev
* @since 4.0

View File

@ -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.
@ -95,7 +95,7 @@ public class StandardWebSocketSession extends AbstractWebSocketSession<Session>
* @param localAddress the address on which the request was received
* @param remoteAddress the address of the remote client
* @param user the user associated with the session; if {@code null} we'll
* fallback on the user available in the underlying WebSocket session
* fall back on the user available in the underlying WebSocket session
*/
public StandardWebSocketSession(@Nullable HttpHeaders headers, @Nullable Map<String, Object> attributes,
@Nullable InetSocketAddress localAddress, @Nullable InetSocketAddress remoteAddress,

View File

@ -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.
@ -81,7 +81,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
/**
* Specify the phase in which a connection should be established to the remote
* endpoint and subsequently closed. The startup order proceeds from lowest to
* highest, and the shutdown order is the reverse of that. By default this value is
* highest, and the shutdown order is the reverse of that. By default, this value is
* Integer.MAX_VALUE meaning that this endpoint connection factory connects as late as
* possible and is closed as soon as possible.
*/

View File

@ -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.
@ -199,7 +199,7 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Lif
/**
* Return the user to make available through {@link WebSocketSession#getPrincipal()}.
* By default this method returns {@code null}
* By default, this method returns {@code null}
*/
@Nullable
protected Principal getUser() {

View File

@ -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,7 +36,7 @@ import org.springframework.web.socket.sockjs.transport.handler.WebSocketTranspor
/**
* Base class for {@link WebSocketHandlerRegistration WebSocketHandlerRegistrations} that gathers all the configuration
* options but allows sub-classes to put together the actual HTTP request mappings.
* options but allows subclasses to put together the actual HTTP request mappings.
*
* @author Rossen Stoyanchev
* @author Sebastien Deleuze

View File

@ -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.
@ -120,7 +120,7 @@ public class SockJsServiceRegistration {
* Streaming transports save responses on the client side and don't free
* memory used by delivered messages. Such transports need to recycle the
* connection once in a while. This property sets a minimum number of bytes
* that can be send over a single HTTP streaming request before it will be
* that can be sent over a single HTTP streaming request before it will be
* closed. After that client will open a new request. Setting this value to
* one effectively disables streaming and will make streaming transports to
* behave like polling transports.

View File

@ -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.
@ -52,7 +52,7 @@ public interface WebSocketMessageBrokerConfigurer {
/**
* Configure the {@link org.springframework.messaging.MessageChannel} used for
* incoming messages from WebSocket clients. By default the channel is backed
* incoming messages from WebSocket clients. By default, the channel is backed
* by a thread pool of size 1. It is recommended to customize thread pool
* settings for production use.
*/
@ -61,7 +61,7 @@ public interface WebSocketMessageBrokerConfigurer {
/**
* Configure the {@link org.springframework.messaging.MessageChannel} used for
* outbound messages to WebSocket clients. By default the channel is backed
* outbound messages to WebSocket clients. By default, the channel is backed
* by a thread pool of size 1. It is recommended to customize thread pool
* settings for production use.
*/

View File

@ -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.
@ -87,7 +87,7 @@ public class WebSocketTransportRegistration {
* <p><strong>NOTE</strong> that closing the session may not succeed in
* actually closing the physical socket and may also hang. This is true
* especially when using blocking IO such as the BIO connector in Tomcat
* that is used by default on Tomcat 7. Therefore it is recommended to ensure
* that is used by default on Tomcat 7. Therefore, it is recommended to ensure
* the server is using non-blocking IO such as Tomcat's NIO connector that
* is used by default on Tomcat 8. If you must use blocking IO consider
* customizing OS-level TCP settings, for example
@ -123,7 +123,7 @@ public class WebSocketTransportRegistration {
* <p><strong>NOTE</strong> that closing the session may not succeed in
* actually closing the physical socket and may also hang. This is true
* especially when using blocking IO such as the BIO connector in Tomcat
* configured by default on Tomcat 7. Therefore it is recommended to ensure
* configured by default on Tomcat 7. Therefore, it is recommended to ensure
* the server is using non-blocking IO such as Tomcat's NIO connector used
* by default on Tomcat 8. If you must use blocking IO consider customizing
* OS-level TCP settings, for example {@code /proc/sys/net/ipv4/tcp_retries2}

View File

@ -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.
@ -289,7 +289,7 @@ public class ConcurrentWebSocketSessionDecorator extends WebSocketSessionDecorat
public enum OverflowStrategy {
/**
* Throw {@link SessionLimitExceededException} that would will result
* Throw {@link SessionLimitExceededException} that will result
* in the session being terminated.
*/
TERMINATE,

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 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.
@ -34,7 +34,7 @@ public interface WebSocketHandlerDecoratorFactory {
/**
* Decorate the given WebSocketHandler.
* @param handler the handler to be decorated.
* @return the same handler or the handler wrapped with a sub-class of
* @return the same handler or the handler wrapped with a subclass of
* {@code WebSocketHandlerDecorator}.
*/
WebSocketHandler decorate(WebSocketHandler handler);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 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.
@ -30,7 +30,7 @@ import org.springframework.messaging.simp.annotation.support.SimpAnnotationMetho
import org.springframework.web.method.ControllerAdviceBean;
/**
* A sub-class of {@link SimpAnnotationMethodMessageHandler} to provide support
* A subclass of {@link SimpAnnotationMethodMessageHandler} to provide support
* for {@link org.springframework.web.bind.annotation.ControllerAdvice
* ControllerAdvice} with global {@code @MessageExceptionHandler} methods.
*

View File

@ -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.
@ -66,7 +66,7 @@ public class ServerEndpointExporter extends WebApplicationObjectSupport
/**
* Explicitly list annotated endpoint types that should be registered on startup. This
* can be done if you wish to turn off a Servlet container's scan for endpoints, which
* goes through all 3rd party jars in the, and rely on Spring configuration instead.
* goes through all 3rd party jars in the classpath, and rely on Spring configuration instead.
* @param annotatedEndpointClasses {@link ServerEndpoint}-annotated types
*/
public void setAnnotatedEndpointClasses(Class<?>... annotatedEndpointClasses) {

View File

@ -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.
@ -49,7 +49,7 @@ import org.springframework.web.socket.server.HandshakeHandler;
import org.springframework.web.socket.server.RequestUpgradeStrategy;
/**
* A base class for {@link HandshakeHandler} implementations, independent from the Servlet API.
* A base class for {@link HandshakeHandler} implementations, independent of the Servlet API.
*
* <p>Performs initial validation of the WebSocket handshake request - possibly rejecting it
* through the appropriate HTTP status code - while also allowing its subclasses to override
@ -58,7 +58,7 @@ 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
* the response as necessary and initialize the WebSocket. Currently, supported servers are
* Jetty 9.0-9.3, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.3, GlassFish 4.1+, WebLogic 12.1.3+.
*
* @author Rossen Stoyanchev
@ -184,9 +184,9 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
* is accepted. If there are no matches the response will not contain a
* {@literal Sec-WebSocket-Protocol} header.
* <p>Note that if the WebSocketHandler passed in at runtime is an instance of
* {@link SubProtocolCapable} then there is not need to explicitly configure
* {@link SubProtocolCapable} then there is no need to explicitly configure
* this property. That is certainly the case with the built-in STOMP over
* WebSocket support. Therefore this property should be configured explicitly
* WebSocket support. Therefore, this property should be configured explicitly
* only if the WebSocketHandler does not implement {@code SubProtocolCapable}.
*/
public void setSupportedProtocols(String... protocols) {

View File

@ -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.
@ -50,7 +50,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* A SockJS implementation of
* {@link org.springframework.web.socket.client.WebSocketClient WebSocketClient}
* with fallback alternatives that simulate a WebSocket interaction through plain
* HTTP streaming and long polling techniques..
* HTTP streaming and long polling techniques.
*
* <p>Implements {@link Lifecycle} in order to propagate lifecycle events to
* the transports it is configured with.
@ -342,7 +342,7 @@ public class SockJsClient implements WebSocketClient, Lifecycle {
}
/**
* By default the result of a SockJS "Info" request, including whether the
* By default, the result of a SockJS "Info" request, including whether the
* server has WebSocket disabled and how long the request took (used for
* calculating transport timeout time) is cached. This method can be used to
* clear that cache hence causing it to re-populate.

View File

@ -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.
@ -19,7 +19,7 @@ package org.springframework.web.socket.sockjs.frame;
import org.springframework.util.Assert;
/**
* An base class for SockJS message codec that provides an implementation of
* A base class for SockJS message codec that provides an implementation of
* {@link #encode(String[])}.
*
* @author Rossen Stoyanchev

View File

@ -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.
@ -60,7 +60,7 @@ public interface SockJsServiceConfig {
* property since even streaming transports recycle HTTP requests periodically.
* <p>The amount of time between HTTP requests should be relatively brief and will not
* exceed the allows disconnect delay (see
* {@link org.springframework.web.socket.sockjs.support.AbstractSockJsService#setDisconnectDelay(long)},
* {@link org.springframework.web.socket.sockjs.support.AbstractSockJsService#setDisconnectDelay(long)}),
* 5 seconds by default.
* <p>The default size is 100.
*/

View File

@ -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.
@ -61,7 +61,7 @@ public abstract class AbstractSockJsSession implements SockJsSession {
* Log category to use on network IO exceptions after a client has gone away.
* <p>Servlet containers don't expose a client disconnected callback; see
* <a href="https://github.com/eclipse-ee4j/servlet-api/issues/44">eclipse-ee4j/servlet-api#44</a>.
* Therefore network IO failures may occur simply because a client has gone away,
* Therefore, network IO failures may occur simply because a client has gone away,
* and that can fill the logs with unnecessary stack traces.
* <p>We make a best effort to identify such network failures, on a per-server
* basis, and log them under a separate log category. A simple one-line message

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 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.
@ -159,7 +159,7 @@ public class WebSocketServerSockJsSession extends AbstractSockJsSession implemen
delegateConnectionEstablished();
this.webSocketSession.sendMessage(new TextMessage(SockJsFrame.openFrame().getContent()));
// Flush any messages cached in the mean time
// Flush any messages cached in the meantime
while (!this.initSessionCache.isEmpty()) {
writeFrame(SockJsFrame.messageFrame(getMessageCodec(), this.initSessionCache.poll()));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 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 static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
/**
* Test fixture for {@link AbstractHttpReceivingTransportHandler} and sub-classes
* Test fixture for {@link AbstractHttpReceivingTransportHandler} and subclasses
* {@link XhrReceivingTransportHandler}.
*
* @author Rossen Stoyanchev

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 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,7 +36,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
/**
* Test fixture for {@link AbstractHttpSendingTransportHandler} and sub-classes.
* Test fixture for {@link AbstractHttpSendingTransportHandler} and subclasses.
*
* @author Rossen Stoyanchev
*/