public class OrderedResultsExecutor<RESULT>
extends java.lang.Object
addTask(org.pvalsecc.concurrent.OrderedResultsExecutor.Task<RESULT>, org.pvalsecc.concurrent.OrderedResultsExecutor.ResultCollector<RESULT>) is thread safe
OrderedResultsExecutor.ResultCollector.handle(Object)
is called only one result at a time for a given instance of OrderedResultsExecutor.ResultCollector.
No // call of this method for a given object.
| Modifier and Type | Class and Description |
|---|---|
static interface |
OrderedResultsExecutor.ResultCollector<RESULT>
Definition of a result collector.
|
class |
OrderedResultsExecutor.Runner
One executor thread.
|
static interface |
OrderedResultsExecutor.Task<RESULT>
Definition of a task.
|
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOGGER |
| Constructor and Description |
|---|
OrderedResultsExecutor(int nbThreads,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTask(OrderedResultsExecutor.Task<RESULT> command,
OrderedResultsExecutor.ResultCollector<RESULT> resultCollector)
Adds a task whose result will be sent to the given resultCollector.
|
void |
start()
Start the executor threads.
|
void |
stop()
Stop the executor threads.
|
public OrderedResultsExecutor(int nbThreads,
java.lang.String name)
public void start()
public void stop()
public void addTask(OrderedResultsExecutor.Task<RESULT> command, OrderedResultsExecutor.ResultCollector<RESULT> resultCollector)