Class SearchIndexerImpl.WorkerThreadPool
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.searchindex.SearchIndexerImpl.WorkerThreadPool
-
- Enclosing class:
- SearchIndexerImpl
public static class SearchIndexerImpl.WorkerThreadPool extends Object
A thread pool for handling many small units of work submitted by a task. The task is notified as each unit completes. If no thread is available for a work unit, the thread of the task itself will run it. This provides automatic throttling. Only one task is active at a time, so the task can simply wait until this pool is idle to know that all of its units have completed. When shutting down, no attempt is made to interrupt the currently executing work units, since they are assumed to be small.
-
-
Constructor Summary
Constructors Constructor Description WorkerThreadPool(int threadPoolSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidshutdown()voidsubmit(Runnable workUnit, SearchIndexerImpl.Task task)voidwaitUntilIdle()
-
-
-
Method Detail
-
submit
public void submit(Runnable workUnit, SearchIndexerImpl.Task task)
-
waitUntilIdle
public void waitUntilIdle()
-
shutdown
public void shutdown()
-
-