org.carrot2.util
Class ExecutorServiceUtils
java.lang.Object
org.carrot2.util.ExecutorServiceUtils
public class ExecutorServiceUtils
- extends Object
A number of utility methods for working with the Executors framework.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExecutorServiceUtils
public ExecutorServiceUtils()
createExecutorService
public static ExecutorService createExecutorService(int maxConcurrentThreads,
Class<?> clazz)
- Returns:
- Return an executor service with a fixed thread pool of
maxConcurrentThreads threads and context class loader
initialized to clazz's context class loader.
A weak reference to the returned object is saved internally to make the
necessary cleanups in Web applications and other dynamic environments
possible. See CARROT-388.
Copyright (c) Dawid Weiss, Stanislaw Osinski