public class ThreadedWorkerManager extends Object implements WorkerManager, Interruptible
| Constructor and Description |
|---|
ThreadedWorkerManager(ExecutorService executor)
Constructs a threaded worker manager with a specified executor.
|
ThreadedWorkerManager(int numThreads)
Constructs a fix thread worker with a specified number of threads.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Worker |
getWorker()
Get the result collector in use.
|
void |
interruptAndClose()
Interrupt a thread and then close it.
|
public ThreadedWorkerManager(int numThreads)
numThreads - Number of threadspublic ThreadedWorkerManager(ExecutorService executor)
executor - An executor servicepublic final Worker getWorker()
WorkerManagergetWorker in interface WorkerManagerpublic final void interruptAndClose()
throws InterruptedException
InterruptibleinterruptAndClose in interface InterruptibleInterruptedExceptionpublic final void close()
throws InterruptedException
close in interface AutoCloseableInterruptedExceptionCopyright © 2018. All rights reserved.