T - type of object returned by this processpublic abstract class BackgroundTask<T> extends Object
| Constructor and Description |
|---|
BackgroundTask() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
backgroundTaskCompleted(T returnValue,
Throwable throwable)
This method will be invoked to indicate that the background task has
completed.
|
void |
interrupt()
Interrupts the thread that is running background.
|
boolean |
isInterrupted()
Returns
true if the thread running in the background is
interrupted and false otherwise. |
abstract T |
processBackgroundTask()
Performs all processing associated with the task.
|
void |
startBackgroundTask()
Creates a new thread and begins running the task in the background.
|
public BackgroundTask()
public final void startBackgroundTask()
backgroundTaskCompleted method will be
invoked.public final void interrupt()
public boolean isInterrupted()
true if the thread running in the background is
interrupted and false otherwise.true if the thread running in the background is
interrupted and false otherwise.public abstract T processBackgroundTask() throws Throwable
Object with information about the processing performed
for this task, or null if no return value is needed.Throwable - throwable that will be passed through the method
backgroundTaskCompleted.public abstract void backgroundTaskCompleted(T returnValue, Throwable throwable)
Throwable argument will be null and the returnValue
argument will contain the value returned by the
processBackgroundTask method. If an exception or error was thrown,
then the throwable argument will not be null.returnValue - The value returned by the
processBackgroundTask method when processing
completed, or null if no value was returned or
an exception was encountered during processing.throwable - A Throwable instance (e.g., an exception) that
was raised during processing, or null if all
processing completed successfully.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.