public class ConfigurableTask extends Object implements Task
| Constructor and Description |
|---|
ConfigurableTask(Task task) |
| Modifier and Type | Method and Description |
|---|---|
ConfigurableTask |
andThen(Task thatTask)
Returns new task.
|
void |
close()
Performs cleanup for given task, i.e. closes files and any other resources,
removes temporary files or database records, etc
|
ConfigurableTask |
closeAfterEachRun()
Returns new task.
|
ConfigurableTask |
closingTask()
Returns new task.
|
ConfigurableTask |
log(Logger logger,
String name)
Returns new task.
|
ConfigurableTask |
repeat()
Returns new task.
|
ConfigurableTask |
repeat(long pause,
TimeUnit unit)
Returns new task.
|
void |
run()
Performs actual work associated with given task
|
void |
stop()
Interrupts current work performed by task and abort any unfinished work
|
ConfigurableTask |
swallowExceptions(Logger logger,
long pause,
TimeUnit unit)
Returns new task.
|
ConfigurableTask |
unstoppable()
Returns new task.
|
ConfigurableTask |
withAdditinalClosingAction(Runnable closingAction)
Returns new task.
|
ConfigurableTask |
withoutClose()
Returns new task.
|
public ConfigurableTask(Task task)
task - task to inherit behaviour frompublic void stop()
Taskpublic void run()
Taskpublic void close()
Taskpublic ConfigurableTask repeat(long pause, TimeUnit unit)
pause - pause between invocations of this task's #run methodunit - TimeUnit to use for pausepublic ConfigurableTask repeat()
public ConfigurableTask log(Logger logger, String name)
logger - logger that is used to log method invocationsname - name of the task to use in log recordspublic ConfigurableTask swallowExceptions(Logger logger, long pause, TimeUnit unit)
logger - logger that is used to log exceptionspublic ConfigurableTask andThen(Task thatTask)
thatTask - task to run after this taskpublic ConfigurableTask closeAfterEachRun()
Close method of resulting task does nothing
public ConfigurableTask unstoppable()
public ConfigurableTask withoutClose()
public ConfigurableTask closingTask()
public ConfigurableTask withAdditinalClosingAction(Runnable closingAction)
closingAction - additinal closing actionCopyright © 2013. All Rights Reserved.