public class SampleProcessorService extends Object
BlockingThreadPoolExecutor.| Constructor and Description |
|---|
SampleProcessorService(int maxThreads) |
SampleProcessorService(int maxThreads,
Set<SampleProcessor> processors) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitShutdown(long timeout,
TimeUnit unit)
Invokes
awaitShutdown() on the underlying thread pool executor. |
void |
shutdown()
Calls
shutdown() on the underlying thread pool executor. |
void |
submit(Collection<Sample> samples)
Submits a collection of samples to each of the underlying
SampleProcessors. |
public SampleProcessorService(int maxThreads)
@Inject
public SampleProcessorService(@Named(value="sampleProcessor.maxThreads")
int maxThreads,
Set<SampleProcessor> processors)
public void submit(Collection<Sample> samples)
SampleProcessors. Calls to
submit(Collection) are non-blocking unless the pool is unable
to keep up and the queue becomes full.samples - public void shutdown()
throws InterruptedException
shutdown() on the underlying thread pool executor.InterruptedExceptionpublic boolean awaitShutdown(long timeout,
TimeUnit unit)
throws InterruptedException
awaitShutdown() on the underlying thread pool executor.timeout - the maximum time to waitunit - the time unit of the timeout argumentInterruptedExceptionCopyright © 2016. All rights reserved.