Package engineering.swat.watch
Class DaemonThreadPool
- java.lang.Object
-
- engineering.swat.watch.DaemonThreadPool
-
public class DaemonThreadPool extends Object
Build thread pools that even when not properly shutdown, will still not prevent the termination of the JVM.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorServicebuildConstrainedCached(String name, int maxThreads)Generate a thread pool that will reuse threads, clear them after a while, but constrain the total amount of threads.
-
-
-
Method Detail
-
buildConstrainedCached
public static ExecutorService buildConstrainedCached(String name, int maxThreads)
Generate a thread pool that will reuse threads, clear them after a while, but constrain the total amount of threads.- Parameters:
name- name of the thread poolmaxThreads- the maximum amount of threads to start in this pool, after this things will get queued.- Returns:
- an exectutor with deamon threads and constainted to a certain maximum
-
-