Package org.komamitsu.fluency.util
Class ExecutorServiceUtils
- java.lang.Object
-
- org.komamitsu.fluency.util.ExecutorServiceUtils
-
public class ExecutorServiceUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ExecutorServiceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfinishExecutorService(java.util.concurrent.ExecutorService executorService)static voidfinishExecutorService(java.util.concurrent.ExecutorService executorService, long waitSecond)static java.util.concurrent.ScheduledExecutorServicenewScheduledDaemonThreadPool(int corePoolSize)Creates a scheduled thread pool where each thread has the daemon property set to true.static java.util.concurrent.ExecutorServicenewSingleThreadDaemonExecutor()Creates an Executor that is based on daemon threads.
-
-
-
Method Detail
-
newSingleThreadDaemonExecutor
public static java.util.concurrent.ExecutorService newSingleThreadDaemonExecutor()
Creates an Executor that is based on daemon threads. This allows the program to quit without explicitly calling shutdown on the pool- Returns:
- the newly created single-threaded Executor
-
newScheduledDaemonThreadPool
public static java.util.concurrent.ScheduledExecutorService newScheduledDaemonThreadPool(int corePoolSize)
Creates a scheduled thread pool where each thread has the daemon property set to true. This allows the program to quit without explicitly calling shutdown on the pool- Parameters:
corePoolSize- the number of threads to keep in the pool, even if they are idle- Returns:
- a newly created scheduled thread pool
-
finishExecutorService
public static void finishExecutorService(java.util.concurrent.ExecutorService executorService)
-
finishExecutorService
public static void finishExecutorService(java.util.concurrent.ExecutorService executorService, long waitSecond)
-
-