org.carrot2.util
Class ExecutorServiceUtils

java.lang.Object
  extended by org.carrot2.util.ExecutorServiceUtils

public class ExecutorServiceUtils
extends Object

A number of utility methods for working with the Executors framework.


Constructor Summary
ExecutorServiceUtils()
           
 
Method Summary
static ExecutorService createExecutorService(int maxConcurrentThreads, Class<?> clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutorServiceUtils

public ExecutorServiceUtils()
Method Detail

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