From 358a345e73fa742fad5b8e361adb95e2ac53dbe0 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Tue, 23 Apr 2024 11:02:07 +0200 Subject: [PATCH] WebSockets Next: rename config and properties - rename WebSocketsRuntimeConfig to WebSocketsServerRuntimeConfig - change the prefix from "quarkus.websockets-next" to "quarkus.websockets.next.server" --- .../next/deployment/WebSocketServerProcessor.java | 6 +++--- .../next/test/maxmessagesize/MaxMessageSizeTest.java | 2 +- .../next/test/pingpong/AutoPingIntervalTest.java | 2 +- .../next/test/subprotocol/SubprotocolSelectedTest.java | 2 +- ...eConfig.java => WebSocketsServerRuntimeConfig.java} | 4 ++-- .../websockets/next/runtime/WebSocketEndpointBase.java | 6 +++--- .../runtime/WebSocketHttpServerOptionsCustomizer.java | 4 ++-- .../next/runtime/WebSocketServerRecorder.java | 10 +++++----- 8 files changed, 18 insertions(+), 18 deletions(-) rename extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/{WebSocketsRuntimeConfig.java => WebSocketsServerRuntimeConfig.java} (92%) diff --git a/extensions/websockets-next/server/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketServerProcessor.java b/extensions/websockets-next/server/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketServerProcessor.java index 7a7c8f536d1d94..c0216132ab1f11 100644 --- a/extensions/websockets-next/server/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketServerProcessor.java +++ b/extensions/websockets-next/server/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketServerProcessor.java @@ -66,7 +66,7 @@ import io.quarkus.websockets.next.WebSocket; import io.quarkus.websockets.next.WebSocketConnection; import io.quarkus.websockets.next.WebSocketServerException; -import io.quarkus.websockets.next.WebSocketsRuntimeConfig; +import io.quarkus.websockets.next.WebSocketsServerRuntimeConfig; import io.quarkus.websockets.next.deployment.WebSocketEndpointBuildItem.Callback; import io.quarkus.websockets.next.deployment.WebSocketEndpointBuildItem.Callback.MessageType; import io.quarkus.websockets.next.runtime.Codecs; @@ -478,10 +478,10 @@ private String generateEndpoint(WebSocketEndpointBuildItem endpoint, .build(); MethodCreator constructor = endpointCreator.getConstructorCreator(WebSocketConnection.class, - Codecs.class, WebSocketsRuntimeConfig.class, ContextSupport.class); + Codecs.class, WebSocketsServerRuntimeConfig.class, ContextSupport.class); constructor.invokeSpecialMethod( MethodDescriptor.ofConstructor(WebSocketEndpointBase.class, WebSocketConnection.class, - Codecs.class, WebSocketsRuntimeConfig.class, ContextSupport.class), + Codecs.class, WebSocketsServerRuntimeConfig.class, ContextSupport.class), constructor.getThis(), constructor.getMethodParam(0), constructor.getMethodParam(1), constructor.getMethodParam(2), constructor.getMethodParam(3)); constructor.returnNull(); diff --git a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/maxmessagesize/MaxMessageSizeTest.java b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/maxmessagesize/MaxMessageSizeTest.java index 2ffe0778d69f79..5b604a59a5cc4e 100644 --- a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/maxmessagesize/MaxMessageSizeTest.java +++ b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/maxmessagesize/MaxMessageSizeTest.java @@ -25,7 +25,7 @@ public class MaxMessageSizeTest { public static final QuarkusUnitTest test = new QuarkusUnitTest() .withApplicationRoot(root -> { root.addClasses(Echo.class, WSClient.class); - }).overrideConfigKey("quarkus.websockets-next.max-message-size", "10"); + }).overrideConfigKey("quarkus.websockets.next.server.max-message-size", "10"); @Inject Vertx vertx; diff --git a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/pingpong/AutoPingIntervalTest.java b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/pingpong/AutoPingIntervalTest.java index dbeaac143fb49a..b3d6985d35706e 100644 --- a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/pingpong/AutoPingIntervalTest.java +++ b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/pingpong/AutoPingIntervalTest.java @@ -27,7 +27,7 @@ public class AutoPingIntervalTest { public static final QuarkusUnitTest test = new QuarkusUnitTest() .withApplicationRoot(root -> { root.addClasses(Endpoint.class); - }).overrideConfigKey("quarkus.websockets-next.auto-ping-interval", "200"); + }).overrideConfigKey("quarkus.websockets.next.server.auto-ping-interval", "200"); @Inject Vertx vertx; diff --git a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/subprotocol/SubprotocolSelectedTest.java b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/subprotocol/SubprotocolSelectedTest.java index a9e52a296e574f..d9cf33f8c16c44 100644 --- a/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/subprotocol/SubprotocolSelectedTest.java +++ b/extensions/websockets-next/server/deployment/src/test/java/io/quarkus/websockets/next/test/subprotocol/SubprotocolSelectedTest.java @@ -27,7 +27,7 @@ public class SubprotocolSelectedTest { public static final QuarkusUnitTest test = new QuarkusUnitTest() .withApplicationRoot(root -> { root.addClasses(Endpoint.class, WSClient.class); - }).overrideConfigKey("quarkus.websockets-next.supported-subprotocols", "oak,larch"); + }).overrideConfigKey("quarkus.websockets.next.server.supported-subprotocols", "oak,larch"); @Inject Vertx vertx; diff --git a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsRuntimeConfig.java b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsServerRuntimeConfig.java similarity index 92% rename from extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsRuntimeConfig.java rename to extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsServerRuntimeConfig.java index 898aca3b7325cd..65543e2bc09eba 100644 --- a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsRuntimeConfig.java +++ b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsServerRuntimeConfig.java @@ -11,9 +11,9 @@ import io.smallrye.config.WithDefault; import io.vertx.core.http.HttpServerOptions; -@ConfigMapping(prefix = "quarkus.websockets-next") +@ConfigMapping(prefix = "quarkus.websockets.next.server") @ConfigRoot(phase = ConfigPhase.RUN_TIME) -public interface WebSocketsRuntimeConfig { +public interface WebSocketsServerRuntimeConfig { /** * See The WebSocket Protocol diff --git a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java index 261de140f1683a..3a7b4da9dfa338 100644 --- a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java +++ b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java @@ -17,7 +17,7 @@ import io.quarkus.virtual.threads.VirtualThreadsRecorder; import io.quarkus.websockets.next.WebSocket.ExecutionMode; import io.quarkus.websockets.next.WebSocketConnection; -import io.quarkus.websockets.next.WebSocketsRuntimeConfig; +import io.quarkus.websockets.next.WebSocketsServerRuntimeConfig; import io.quarkus.websockets.next.runtime.ConcurrencyLimiter.PromiseComplete; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; @@ -41,7 +41,7 @@ public abstract class WebSocketEndpointBase implements WebSocketEndpoint { private final ConcurrencyLimiter limiter; @SuppressWarnings("unused") - private final WebSocketsRuntimeConfig config; + private final WebSocketsServerRuntimeConfig config; private final ArcContainer container; @@ -51,7 +51,7 @@ public abstract class WebSocketEndpointBase implements WebSocketEndpoint { private final Object beanInstance; public WebSocketEndpointBase(WebSocketConnection connection, Codecs codecs, - WebSocketsRuntimeConfig config, ContextSupport contextSupport) { + WebSocketsServerRuntimeConfig config, ContextSupport contextSupport) { this.connection = connection; this.codecs = codecs; this.limiter = executionMode() == ExecutionMode.SERIAL ? new ConcurrencyLimiter(connection) : null; diff --git a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketHttpServerOptionsCustomizer.java b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketHttpServerOptionsCustomizer.java index 5233fd4a1cc34f..1ca59b18aec3af 100644 --- a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketHttpServerOptionsCustomizer.java +++ b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketHttpServerOptionsCustomizer.java @@ -6,14 +6,14 @@ import jakarta.inject.Inject; import io.quarkus.vertx.http.HttpServerOptionsCustomizer; -import io.quarkus.websockets.next.WebSocketsRuntimeConfig; +import io.quarkus.websockets.next.WebSocketsServerRuntimeConfig; import io.vertx.core.http.HttpServerOptions; @Dependent public class WebSocketHttpServerOptionsCustomizer implements HttpServerOptionsCustomizer { @Inject - WebSocketsRuntimeConfig config; + WebSocketsServerRuntimeConfig config; @Override public void customizeHttpServer(HttpServerOptions options) { diff --git a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketServerRecorder.java b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketServerRecorder.java index 4fb2598b8b1d08..2b6338ace12a5b 100644 --- a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketServerRecorder.java +++ b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketServerRecorder.java @@ -14,7 +14,7 @@ import io.quarkus.vertx.core.runtime.VertxCoreRecorder; import io.quarkus.websockets.next.WebSocketConnection; import io.quarkus.websockets.next.WebSocketServerException; -import io.quarkus.websockets.next.WebSocketsRuntimeConfig; +import io.quarkus.websockets.next.WebSocketsServerRuntimeConfig; import io.quarkus.websockets.next.runtime.WebSocketSessionContext.SessionContextState; import io.smallrye.common.vertx.VertxContext; import io.smallrye.mutiny.Multi; @@ -34,9 +34,9 @@ public class WebSocketServerRecorder { static final String WEB_SOCKET_CONN_KEY = WebSocketConnection.class.getName(); - private final WebSocketsRuntimeConfig config; + private final WebSocketsServerRuntimeConfig config; - public WebSocketServerRecorder(WebSocketsRuntimeConfig config) { + public WebSocketServerRecorder(WebSocketsServerRuntimeConfig config) { this.config = config; } @@ -324,7 +324,7 @@ public void handle(Void event) { } private WebSocketEndpoint createEndpoint(String endpointClassName, Context context, WebSocketConnection connection, - Codecs codecs, WebSocketsRuntimeConfig config, ContextSupport contextSupport) { + Codecs codecs, WebSocketsServerRuntimeConfig config, ContextSupport contextSupport) { try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { @@ -335,7 +335,7 @@ private WebSocketEndpoint createEndpoint(String endpointClassName, Context conte .loadClass(endpointClassName); WebSocketEndpoint endpoint = (WebSocketEndpoint) endpointClazz .getDeclaredConstructor(WebSocketConnection.class, Codecs.class, - WebSocketsRuntimeConfig.class, ContextSupport.class) + WebSocketsServerRuntimeConfig.class, ContextSupport.class) .newInstance(connection, codecs, config, contextSupport); return endpoint; } catch (Exception e) {