Class CancelOnInterruptWrapper<ResultT>
- java.lang.Object
-
- software.amazon.awssdk.http.apache5.internal.utils.CancelOnInterruptWrapper<ResultT>
-
- All Implemented Interfaces:
Future<ResultT>
@SdkInternalApi public final class CancelOnInterruptWrapper<ResultT> extends Object implements Future<ResultT>
Wrapper that attempts to cancel the delegate future if the thread is interrupted within get().
-
-
Constructor Summary
Constructors Constructor Description CancelOnInterruptWrapper(Future<? extends ResultT> f)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)ResultTget()ResultTget(long timeout, TimeUnit unit)booleanisCancelled()booleanisDone()
-
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<ResultT>
-
get
public ResultT get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<ResultT>- Throws:
InterruptedExceptionExecutionException
-
get
public ResultT get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<ResultT>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-