Class InterruptMonitor
- java.lang.Object
-
- software.amazon.awssdk.core.internal.http.InterruptMonitor
-
public final class InterruptMonitor extends Object
A set of utilities for monitoring the status of the currently-executing SDK thread. This is useful for periodically checking whether our thread has been interrupted so that we can abort execution of a request.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkInterrupted()
Check if the thread has been interrupted.static void
checkInterrupted(SdkHttpFullResponse response)
Check if the thread has been interrupted.
-
-
-
Method Detail
-
checkInterrupted
public static void checkInterrupted() throws InterruptedException
Check if the thread has been interrupted. If so throw anInterruptedException
. Long running tasks should be periodically checked if the current thread has been interrupted and handle it appropriately- Throws:
InterruptedException
- If thread has been interrupted
-
checkInterrupted
public static void checkInterrupted(SdkHttpFullResponse response) throws InterruptedException
Check if the thread has been interrupted. If so throw anInterruptedException
. Long running tasks should be periodically checked if the current thread has been interrupted and handle it appropriately- Parameters:
response
- Response to be closed before returning control to the caller to avoid leaking the connection.- Throws:
InterruptedException
- If thread has been interrupted
-
-