Class SyncTimeoutTask
- java.lang.Object
-
- software.amazon.awssdk.core.internal.http.timers.SyncTimeoutTask
-
- All Implemented Interfaces:
Runnable
,TimeoutTask
public final class SyncTimeoutTask extends Object implements TimeoutTask
TimeoutTask
to be scheduled for synchronous operations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortable(Abortable abortable)
void
cancel()
Cancels this task.boolean
hasExecuted()
Returns whether this task has finished executing its timeout behavior.void
run()
Runs this task.
-
-
-
Method Detail
-
abortable
public void abortable(Abortable abortable)
- Specified by:
abortable
in interfaceTimeoutTask
- Parameters:
abortable
- the abortable request
-
run
public void run()
Runs this task. If cancel() was called prior to this invocation, has no side effects. Otherwise, behaves with the following post-conditions: (1) threadToInterrupt's interrupt flag is set to true (unless a concurrent process clears it); (2) hasExecuted() will return true. Note that run(), cancel(), and hasExecuted() behave atomically - calls to these methods operate with strict happens-before relationships to one another.
-
cancel
public void cancel()
Cancels this task. Once this returns, it's guaranteed that hasExecuted() will not change its value, and that this task won't interrupt the threadToInterrupt this task was created with.- Specified by:
cancel
in interfaceTimeoutTask
-
hasExecuted
public boolean hasExecuted()
Returns whether this task has finished executing its timeout behavior. The interrupt flag set by this task will only be set if hasExecuted() returns true, and is guaranteed not to be set at the time hasExecuted() returns false.- Specified by:
hasExecuted
in interfaceTimeoutTask
- Returns:
- True if timeout task has executed. False otherwise
-
-