IN - Input type of this task. Can be Object to mark that input in not relevant for this task.OUT - Output type of this task.public abstract class Task<IN,OUT> extends Object
| Constructor and Description |
|---|
Task() |
| Modifier and Type | Method and Description |
|---|---|
Execution<OUT> |
execute()
Asynchronously executes current chain of tasks.
|
protected ExecutionService |
getExecutionService()
Returns
ExecutionService. |
protected abstract OUT |
process(IN input)
Represents a transformation of
input into output. |
protected OUT |
run()
Transforms a chain of tasks into action that will be executed asynchronously.
|
protected Task<IN,OUT> |
setExecutionService(ExecutionService executionService)
Sets
ExecutionService to be used to execute this task asynchronously |
protected void |
setPreviousTask(Task<?,? extends IN> previous)
Sets previous task
|
<OUT_2,TASK_2 extends Task<? super OUT,OUT_2>> |
then(Class<TASK_2> nextTask)
Allows to connect current task with next task, given the output of this task matches input of next task
|
public <OUT_2,TASK_2 extends Task<? super OUT,OUT_2>> TASK_2 then(Class<TASK_2> nextTask)
nextTask - Task to be executed right after this task is finishedpublic Execution<OUT> execute() throws ExecutionException
ExecutionExceptionprotected abstract OUT process(IN input) throws Exception
input into output.input - Input of this task, can be ignoredException - if processing fails for any reasonprotected OUT run() throws ExecutionException
ExecutionExceptionprotected ExecutionService getExecutionService()
ExecutionService. If using Tasks or ToolRegistry, this method is guaranteed to never
return nullprotected void setPreviousTask(Task<?,? extends IN> previous)
previous - protected Task<IN,OUT> setExecutionService(ExecutionService executionService)
ExecutionService to be used to execute this task asynchronouslyexecutionService - Copyright © 2014 JBoss by Red Hat. All rights reserved.