Skip to content

Commit

Permalink
Deprecate JettyWebSocketClient in favor of StandardWebSocketClient
Browse files Browse the repository at this point in the history
JettyWebSocketClient only supported on Jetty 11, to be phased out.

Closes gh-29576
  • Loading branch information
jhoeller committed Nov 25, 2022
1 parent 45d45c2 commit 9c7b471
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
Expand Up @@ -39,6 +39,7 @@
/**
* A {@link WebSocketClient} implementation for use with Jetty
* {@link org.eclipse.jetty.websocket.client.WebSocketClient}.
* Only supported on Jetty 11, superseded by {@link StandardWebSocketClient}.
*
* <p><strong>Note: </strong> the Jetty {@code WebSocketClient} requires
* lifecycle management and must be started and stopped. This is automatically
Expand All @@ -49,7 +50,9 @@
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @since 5.0
* @deprecated as of 6.0.3, in favor of {@link StandardWebSocketClient}
*/
@Deprecated(since = "6.0.3", forRemoval = true)
public class JettyWebSocketClient implements WebSocketClient, Lifecycle {

private static final Log logger = LogFactory.getLog(JettyWebSocketClient.class);
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 Down Expand Up @@ -91,6 +91,7 @@ abstract class AbstractWebSocketIntegrationTests {

static Stream<Object[]> arguments() throws IOException {

@SuppressWarnings("removal")
WebSocketClient[] clients = new WebSocketClient[] {
new TomcatWebSocketClient(),
new JettyWebSocketClient(),
Expand Down
Expand Up @@ -45,7 +45,8 @@

/**
* Initiates WebSocket requests to a WebSocket server programmatically
* through the Jetty WebSocket API.
* through the Jetty WebSocket API. Only supported on Jetty 11, superseded by
* {@link org.springframework.web.socket.client.standard.StandardWebSocketClient}.
*
* <p>As of 4.1 this class implements {@link Lifecycle} rather than
* {@link org.springframework.context.SmartLifecycle}. Use
Expand All @@ -55,7 +56,10 @@
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @since 4.0
* @deprecated as of 6.0.3, in favor of
* {@link org.springframework.web.socket.client.standard.StandardWebSocketClient}
*/
@Deprecated(since = "6.0.3", forRemoval = true)
public class JettyWebSocketClient extends AbstractWebSocketClient implements Lifecycle {

private final org.eclipse.jetty.websocket.client.WebSocketClient client;
Expand Down
Expand Up @@ -65,6 +65,7 @@ public abstract class AbstractWebSocketIntegrationTests {
upgradeStrategyConfigTypes.put(UndertowTestServer.class, UndertowUpgradeStrategyConfig.class);
}

@SuppressWarnings("removal")
static Stream<Arguments> argumentsFactory() {
return Stream.of(
arguments(named("Jetty", new JettyWebSocketTestServer()), named("Jetty", new JettyWebSocketClient())),
Expand Down
Expand Up @@ -42,6 +42,7 @@ protected JettyWebSocketTestServer createWebSocketTestServer() {
return new JettyWebSocketTestServer();
}

@SuppressWarnings("removal")
@Override
protected Transport createWebSocketTransport() {
return new WebSocketTransport(new JettyWebSocketClient());
Expand Down

0 comments on commit 9c7b471

Please sign in to comment.