public class DefaultSampleProcessorService extends Object implements SampleProcessorService
BlockingThreadPoolExecutor.| Constructor and Description |
|---|
DefaultSampleProcessorService(int maxThreads) |
DefaultSampleProcessorService(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 DefaultSampleProcessorService(int maxThreads)
@Inject
public DefaultSampleProcessorService(@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.submit in interface SampleProcessorServicesamples - public void shutdown()
throws InterruptedException
shutdown() on the underlying thread pool executor.shutdown in interface SampleProcessorServiceInterruptedExceptionpublic boolean awaitShutdown(long timeout,
TimeUnit unit)
throws InterruptedException
awaitShutdown() on the underlying thread pool executor.awaitShutdown in interface SampleProcessorServicetimeout - the maximum time to waitunit - the time unit of the timeout argumentInterruptedExceptionCopyright © 2019. All rights reserved.