T
- Type of Node/Task IDR
- Type of Node/Task resultpublic final class DefaultExecutionEngine<T,R> extends Object implements ExecutionEngine<T,R>
Constructor and Description |
---|
DefaultExecutionEngine(DexecutorState<T,R> state,
ExecutorService executorService) |
DefaultExecutionEngine(DexecutorState<T,R> state,
ExecutorService executorService,
ExecutionListener<T,R> listener)
Creates the default instance given @ExecutorService, internally it uses @CompletionService
|
Modifier and Type | Method and Description |
---|---|
boolean |
isAnyTaskInError() |
boolean |
isDistributed()
Hints dexecutor if the execution engine is distributed or not
|
ExecutionResult<T,R> |
processResult()
This method is expected to block, if there are no execution result, otherwise return the result immediately.
|
void |
setExecutionListener(ExecutionListener<T,R> listener)
Sets the ExecutionListener
|
void |
submit(Task<T,R> task)
Submits the task for execution, the method is expected to return immediately.
|
String |
toString() |
public DefaultExecutionEngine(DexecutorState<T,R> state, ExecutorService executorService)
public DefaultExecutionEngine(DexecutorState<T,R> state, ExecutorService executorService, ExecutionListener<T,R> listener)
state
- the stateexecutorService
- Underlying execution service, where in tasks would be scheduled.listener
- to notifypublic ExecutionResult<T,R> processResult()
ExecutionEngine
processResult
in interface ExecutionEngine<T,R>
public void submit(Task<T,R> task)
ExecutionEngine
submit
in interface ExecutionEngine<T,R>
task
- to be submitted for executionpublic boolean isDistributed()
ExecutionEngine
isDistributed
in interface ExecutionEngine<T,R>
true
If this execution engine is a distributed
false
it it is non distributedpublic boolean isAnyTaskInError()
isAnyTaskInError
in interface ExecutionEngine<T,R>
true
if there are any task errors identified till that instance of time
false
otherwise.public void setExecutionListener(ExecutionListener<T,R> listener)
ExecutionEngine
setExecutionListener
in interface ExecutionEngine<T,R>
listener
- to notifyCopyright © 2016–2018 Dexecutor. All rights reserved.