public class InterruptionChecker
extends java.lang.Object
| Constructor and Description |
|---|
InterruptionChecker() |
| Modifier and Type | Method and Description |
|---|---|
void |
check()
Check if this thread or any other thread that shares this InterruptionChecker instance has been interrupted
or has thrown an exception, and if so, throw InterruptedException.
|
boolean |
checkAndReturn()
Check for interruption and return interruption status.
|
static java.lang.Throwable |
getCause(java.lang.Throwable throwable)
Get the cause of an
ExecutionException. |
java.util.concurrent.ExecutionException |
getExecutionException()
Get the
ExecutionException that was thrown by a worker, or null if none. |
void |
interrupt()
Interrupt all threads that share this InterruptionChecker.
|
void |
setExecutionException(java.util.concurrent.ExecutionException executionException)
Set the
ExecutionException that was thrown by a worker. |
public void interrupt()
public void setExecutionException(java.util.concurrent.ExecutionException executionException)
ExecutionException that was thrown by a worker.executionException - the execution exception that was thrownpublic java.util.concurrent.ExecutionException getExecutionException()
ExecutionException that was thrown by a worker, or null if none.ExecutionException that was thrown by a worker, or null if none.public static java.lang.Throwable getCause(java.lang.Throwable throwable)
ExecutionException.throwable - the Throwablepublic boolean checkAndReturn()
public void check()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
java.lang.InterruptedException - If a thread has been interrupted.java.util.concurrent.ExecutionException - if a thread has thrown an uncaught exception.