public class InterruptionChecker extends Object
Constructor | Description |
---|---|
InterruptionChecker() |
Modifier and Type | Method | 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() |
|
ExecutionException |
executionException(Exception e) |
Stop all threads that share this InterruptionChecker due to an exception being thrown in one of them.
|
void |
interrupt() |
Interrupt all threads that share this InterruptionChecker.
|
public void interrupt()
public boolean checkAndReturn()
public void check() throws InterruptedException, ExecutionException
InterruptedException
- If this thread or any other thread that shares this InterruptionChecker instance has been
interrupted.ExecutionException
- If this thread or any other thread that shares this InterruptionChecker instance has thrown an
exception.public ExecutionException executionException(Exception e)
e
- The exception that was thrown.ExecutionException
.Copyright © 2018. All rights reserved.