public class TaskUtil
extends java.lang.Object
AsyncTask framework.| Modifier and Type | Method and Description |
|---|---|
static void |
checkAndRethrowNonErrorExceptions(java.lang.Exception e)
Rethrows the Exception if it is one of
StopException,
InterruptedException or CancellationException. |
static void |
checkForErrorAndRethrow(RunStateFlag stateFlag,
java.lang.Exception e)
Used to store an Error (if any) or a cancellation in the given
RunStateFlag. |
static SwingTaskMonitor |
fetchSwingTaskMonitor(AsyncTask task)
Fetches the
SwingTaskMonitor of the given task. |
static SwingTaskMonitor |
findSwingTaskMonitor(AsyncTask task)
Tries to find a
SwingTaskMonitor in the monitors of the given task. |
static SwingTaskMonitor |
findSwingTaskMonitor(TaskMonitor[] monitors)
Tries to find a
SwingTaskMonitor in the given monitor array. |
static boolean |
isCancellationException(java.lang.Exception e) |
static RunState |
resultingRunStateOf(RunStateFlag flag)
Return the resulting
RunState of a RunStateFlag of a finished task. |
static void |
sleepChecked(AsyncExecutable task,
long millis)
Puts the calling thread to sleep for millis.
|
public static void checkForErrorAndRethrow(RunStateFlag stateFlag, java.lang.Exception e) throws java.lang.Exception
RunStateFlag.
Note that CancellationException. InterruptedException and StopException
are NOT considered to be an error. In any case the given Exception is rethrown.java.lang.Exceptionpublic static void checkAndRethrowNonErrorExceptions(java.lang.Exception e)
throws java.lang.Exception
StopException,
InterruptedException or CancellationException.java.lang.Exceptionpublic static boolean isCancellationException(java.lang.Exception e)
public static SwingTaskMonitor fetchSwingTaskMonitor(AsyncTask task)
SwingTaskMonitor of the given task.ProgrammingErrorException - if the task does not have a SwingTaskMonitorpublic static SwingTaskMonitor findSwingTaskMonitor(AsyncTask task)
SwingTaskMonitor in the monitors of the given task.public static SwingTaskMonitor findSwingTaskMonitor(TaskMonitor[] monitors)
SwingTaskMonitor in the given monitor array.public static void sleepChecked(AsyncExecutable task, long millis)
CancellationException is thrown just in case.public static RunState resultingRunStateOf(RunStateFlag flag)
RunState of a RunStateFlag of a finished task.Copyright © 2014 EsprIT-Systems. All Rights Reserved.