Package org.komamitsu.fluency.util
Class ExecutorServiceUtils
java.lang.Object
org.komamitsu.fluency.util.ExecutorServiceUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfinishExecutorService(ExecutorService executorService) static voidfinishExecutorService(ExecutorService executorService, long waitSecond) static ScheduledExecutorServicenewScheduledDaemonThreadPool(int corePoolSize) Creates a scheduled thread pool where each thread has the daemon property set to true.static ExecutorServiceCreates an Executor that is based on daemon threads.
-
Constructor Details
-
ExecutorServiceUtils
public ExecutorServiceUtils()
-
-
Method Details
-
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
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
-
finishExecutorService
-