public interface Pauseable
extends java.lang.Runnable
A task that can be paused by the platform.
This interface should be implemented by all tasks that want to support pausing of the computation.
The paused task should not exit the Runnable.run()
method. If it exits the method as a result of the pause()
call, it will be considered finished.
Modifier and Type | Method and Description |
---|---|
void |
pause()
Pauses the task.
|
void |
resume()
Resumes the task.
|
void pause()
Pauses the task.
This method is called by the worker service when the “pause” is requested on the computation. It may be executed in the event-handling thread of the worker service. Thus, it should not block neither perform any long running operations.
void resume()
Resumes the task.
This method is called by the worker service when the “resume” is requested on the computation. It may be executed in the event-handling thread of the worker service. Thus, it should not block neither perform any long running operations.