Skip to content

Commit

Permalink
Merge pull request #15694 from geoand/websockets-tiny-polish
Browse files Browse the repository at this point in the history
Apply tiny polish to web socket classes
  • Loading branch information
gsmet authored Mar 13, 2021
2 parents 48e9461 + dc2b86e commit f5ca1e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.netty.deployment.EventLoopSupplierBuildItem;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.quarkus.undertow.websockets.runtime.UndertowWebsocketRecorder;
import io.quarkus.undertow.websockets.runtime.WebsocketRecorder;
import io.quarkus.vertx.http.deployment.FilterBuildItem;
import io.undertow.websockets.DefaultContainerConfigurator;
import io.undertow.websockets.UndertowContainerProvider;

public class UndertowWebsocketProcessor {
public class WebsocketProcessor {

private static final DotName SERVER_ENDPOINT = DotName.createSimple(ServerEndpoint.class.getName());
private static final DotName CLIENT_ENDPOINT = DotName.createSimple(ClientEndpoint.class.getName());
Expand Down Expand Up @@ -91,7 +91,7 @@ void scanForAnnotatedEndpoints(CombinedIndexBuildItem indexBuildItem,
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
public FilterBuildItem deploy(final CombinedIndexBuildItem indexBuildItem,
UndertowWebsocketRecorder recorder,
WebsocketRecorder recorder,
BuildProducer<ReflectiveClassBuildItem> reflection,
EventLoopSupplierBuildItem eventLoopSupplierBuildItem,
List<AnnotatedWebsocketEndpointBuildItem> annotatedEndpoints,
Expand Down Expand Up @@ -165,7 +165,7 @@ private void registerForReflection(BuildProducer<ReflectiveClassBuildItem> refle

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
ServiceStartBuildItem setupWorker(UndertowWebsocketRecorder recorder, ExecutorBuildItem exec) {
ServiceStartBuildItem setupWorker(WebsocketRecorder recorder, ExecutorBuildItem exec) {
recorder.setupWorker(exec.getExecutorProxy());
return new ServiceStartBuildItem("Websockets");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import io.vertx.ext.web.RoutingContext;

@Recorder
public class UndertowWebsocketRecorder {
public class WebsocketRecorder {

private static final Logger log = Logger.getLogger(UndertowWebsocketRecorder.class);
private static final Logger log = Logger.getLogger(WebsocketRecorder.class);

public void setupWorker(Executor executor) {
ExecutorSupplier.executor = executor;
Expand Down Expand Up @@ -62,7 +62,7 @@ public WebSocketDeploymentInfo createDeploymentInfo(Set<String> annotatedEndpoin
log.error("Could not initialize websocket class " + i, e);
}
}
Set<Class<?>> newAnnotatatedEndpoints = new HashSet<>();
Set<Class<?>> newAnnotatedEndpoints = new HashSet<>();
Set<ServerEndpointConfig> serverEndpointConfigurations = new HashSet<>();

final Set<ServerApplicationConfig> configInstances = new HashSet<>();
Expand All @@ -79,19 +79,19 @@ public WebSocketDeploymentInfo createDeploymentInfo(Set<String> annotatedEndpoin
for (ServerApplicationConfig config : configInstances) {
Set<Class<?>> returnedEndpoints = config.getAnnotatedEndpointClasses(allScannedAnnotatedEndpoints);
if (returnedEndpoints != null) {
newAnnotatatedEndpoints.addAll(returnedEndpoints);
newAnnotatedEndpoints.addAll(returnedEndpoints);
}
Set<ServerEndpointConfig> endpointConfigs = config.getEndpointConfigs(allScannedEndpointImplementations);
if (endpointConfigs != null) {
serverEndpointConfigurations.addAll(endpointConfigs);
}
}
} else {
newAnnotatatedEndpoints.addAll(allScannedAnnotatedEndpoints);
newAnnotatedEndpoints.addAll(allScannedAnnotatedEndpoints);
}

//annotated endpoints first
for (Class<?> endpoint : newAnnotatatedEndpoints) {
for (Class<?> endpoint : newAnnotatedEndpoints) {
if (endpoint != null) {
container.addEndpoint(endpoint);
}
Expand Down

0 comments on commit f5ca1e4

Please sign in to comment.