Remove unused Utilities.getScheduledThreadPoolExecutor(...)

This commit is contained in:
Alva Swanson 2023-02-05 13:42:39 +01:00
parent e25c27ec99
commit bf95af07bd
No known key found for this signature in database
GPG Key ID: 004760E77F753090

View File

@ -178,24 +178,6 @@ public class Utilities {
return executor;
}
@SuppressWarnings("SameParameterValue")
public static ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor(String name,
int corePoolSize,
int maximumPoolSize,
long keepAliveTimeInSec) {
final ThreadFactory threadFactory = new ThreadFactoryBuilder()
.setNameFormat(name)
.setDaemon(true)
.setPriority(Thread.MIN_PRIORITY)
.build();
ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize, threadFactory);
executor.setKeepAliveTime(keepAliveTimeInSec, TimeUnit.SECONDS);
executor.allowCoreThreadTimeOut(true);
executor.setMaximumPoolSize(maximumPoolSize);
executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
return executor;
}
// TODO: Can some/all of the uses of this be replaced by guava MoreExecutors.shutdownAndAwaitTermination(..)?
public static void shutdownAndAwaitTermination(ExecutorService executor, long timeout, TimeUnit unit) {
executor.shutdown();