public abstract class AbstractCallablePool<T> extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractCallablePool.NamedThreadFactory |
| Modifier and Type | Field and Description |
|---|---|
protected short |
nbThreads |
protected ExecutorService |
supplyThreadPool |
protected ExecutorService |
threadPool |
| Constructor and Description |
|---|
AbstractCallablePool(short nbThreads) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
afterCall(List<T> ret) |
void |
close() |
protected abstract Callable<T> |
getCallable(int i) |
protected abstract T |
getErrorStatus()
Value to return when there was an exception during execution
|
int |
getNbThreads() |
protected abstract String |
getThreadPrefix() |
protected List<T> |
runPool() |
CompletableFuture<List<T>> |
start() |
protected final short nbThreads
protected ExecutorService threadPool
protected ExecutorService supplyThreadPool
public AbstractCallablePool(short nbThreads)
protected abstract T getErrorStatus()
protected abstract Callable<T> getCallable(int i)
protected abstract String getThreadPrefix()
public int getNbThreads()
public CompletableFuture<List<T>> start()
protected List<T> runPool() throws InterruptedException
InterruptedExceptionpublic void close()
close in interface AutoCloseableCopyright © 2019 Nuxeo. All rights reserved.