public class UnitOfWorkExecutorStrategy extends java.lang.Object implements UnitOfWorkSpawnStrategy
Executors.newFixedThreadPool(int)
ExecutorService
to spawn threads.
This is the default spawn strategy.Constructor and Description |
---|
UnitOfWorkExecutorStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
complete(UnitOfWork unitOfWork,
int duration,
java.util.concurrent.TimeUnit unit) |
boolean |
isCompleted(UnitOfWork unitOfWork) |
java.util.List<java.util.concurrent.Future<java.lang.Throwable>> |
start(UnitOfWork unitOfWork,
int maxConcurrentThreads,
java.util.Collection<java.util.concurrent.Callable<java.lang.Throwable>> values) |
public java.util.List<java.util.concurrent.Future<java.lang.Throwable>> start(UnitOfWork unitOfWork, int maxConcurrentThreads, java.util.Collection<java.util.concurrent.Callable<java.lang.Throwable>> values) throws java.lang.InterruptedException
start
in interface UnitOfWorkSpawnStrategy
java.lang.InterruptedException
public boolean isCompleted(UnitOfWork unitOfWork)
isCompleted
in interface UnitOfWorkSpawnStrategy
public void complete(UnitOfWork unitOfWork, int duration, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
complete
in interface UnitOfWorkSpawnStrategy
java.lang.InterruptedException