| Modifier and Type | Field and Description |
|---|---|
| private final AtomicBoolean | interrupted
Set to true when a thread is interrupted. |
| private final AtomicReference | thrownExecutionException
The first |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public 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. |
| public boolean | Returns: true if this thread or any other thread that shares this InterruptionChecker instance has been interrupted or has thrown an exception.Check for interruption and return interruption status. |
| public static Throwable | Returns: the causethe Throwable throwable)Get the cause of an |
| public ExecutionException | Returns: theExecutionException that was thrown by a worker, or null if none.Get the |
| public void | |
| public void | setExecutionException(final ExecutionException
the execution exception that was thrown executionException)Set the |
| interrupted | back to summary |
|---|---|
| private final AtomicBoolean interrupted Set to true when a thread is interrupted. | |
| thrownExecutionException | back to summary |
|---|---|
| private final AtomicReference<ExecutionException> thrownExecutionException The first | |
| InterruptionChecker | back to summary |
|---|---|
| public InterruptionChecker() | |
| check | back to summary |
|---|---|
| public void check() throws InterruptedException, ExecutionException 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.
| |
| checkAndReturn | back to summary |
|---|---|
| public boolean checkAndReturn() Check for interruption and return interruption status.
| |
| getCause | back to summary |
|---|---|
| public static Throwable getCause(final Throwable throwable) Get the cause of an | |
| getExecutionException | back to summary |
|---|---|
| public ExecutionException getExecutionException() Get the
| |
| interrupt | back to summary |
|---|---|
| public void interrupt() Interrupt all threads that share this InterruptionChecker. | |
| setExecutionException | back to summary |
|---|---|
| public void setExecutionException(final ExecutionException executionException) Set the
| |