Skip to content

Commit

Permalink
Checkstyle and copyright fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Langer <[email protected]>
  • Loading branch information
tomas-langer committed Sep 23, 2024
1 parent 4613606 commit b4eb0e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@

package io.helidon.webserver;

import io.helidon.common.task.HelidonTaskExecutor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

/**
import io.helidon.common.task.HelidonTaskExecutor;

/**
* Encapsulates operations with {@link Executors}. Helps to workaround
* limitations of GraalVM for JDK21 which doesn't support execution of
* virtual threads and Graal.js code together. New versions of GraalVM
Expand All @@ -38,31 +39,33 @@ final class ExecutorsFactory {
private ExecutorsFactory() {
}

/** Used by {@link LoomServer} to allocate its executor service.
/**
* Used by {@link LoomServer} to allocate its executor service.
*
* @return {@link Executors#newVirtualThreadPerTaskExecutor()}
*/
static ExecutorService newLoomServerVirtualThreadPerTaskExecutor() {
return Executors.newVirtualThreadPerTaskExecutor();
}

/** Used by {@link ServerListener} to allocate its reader executor.
/**
* Used by {@link ServerListener} to allocate its reader executor.
*
* @return {@link ThreadPerTaskExecutor#create(java.util.concurrent.ThreadFactory)}
*/
static HelidonTaskExecutor newServerListenerReaderExecutor() {
return ThreadPerTaskExecutor.create(virtualThreadFactory());
}

/** Used by {@link ServerListener} to allocate its shared executor.
/**
* Used by {@link ServerListener} to allocate its shared executor.
*
* @return {@link Executors#newThreadPerTaskExecutor(java.util.concurrent.ThreadFactory)}.
*/
static ExecutorService newServerListenerSharedExecutor() {
return Executors.newThreadPerTaskExecutor(virtualThreadFactory());
}


private static ThreadFactory virtualThreadFactory() {
return Thread.ofVirtual().factory();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.Timer;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
* Copyright (c) 2022, 2024 Oracle and/or its affiliates.
*
* 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 @@ -34,7 +34,6 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
Expand All @@ -60,7 +59,6 @@
import static java.lang.System.Logger.Level.ERROR;
import static java.lang.System.Logger.Level.INFO;
import static java.lang.System.Logger.Level.TRACE;
import java.util.concurrent.ThreadFactory;

class ServerListener implements ListenerContext {
private static final System.Logger LOGGER = System.getLogger(ServerListener.class.getName());
Expand Down

0 comments on commit b4eb0e5

Please sign in to comment.