Skip to content

Commit

Permalink
WebSockets Next: rename config and properties
Browse files Browse the repository at this point in the history
- rename WebSocketsRuntimeConfig to WebSocketsServerRuntimeConfig
- change the prefix from "quarkus.websockets-next" to
"quarkus.websockets.next.server"
  • Loading branch information
mkouba committed Apr 23, 2024
1 parent 4b35964 commit 358a345
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://datatracker.ietf.org/doc/html/rfc6455#page-12">The WebSocket Protocol</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 358a345

Please sign in to comment.