Package com.amazonaws.http.timers.client
Class ClientExecutionTimer
- java.lang.Object
-
- com.amazonaws.http.timers.client.ClientExecutionTimer
-
@ThreadSafe public class ClientExecutionTimer extends Object
Represents a timer to enforce a timeout on the total client execution time. That is the time spent executing request handlers, any HTTP request including retries, unmarshalling, etc. Essentially all the time spent inAmazonHttpClient
-
-
Constructor Summary
Constructors Constructor Description ClientExecutionTimer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScheduledThreadPoolExecutorgetExecutor()This method is current exposed for testing purposesvoidshutdown()Shutdown the underlyingScheduledThreadPoolExecutor.ClientExecutionAbortTrackerTaskstartTimer(int clientExecutionTimeoutMillis)Start the timer with the specified timeout and return a object that can be used to track the state of the timer and cancel it if need be.
-
-
-
Method Detail
-
startTimer
public ClientExecutionAbortTrackerTask startTimer(int clientExecutionTimeoutMillis)
Start the timer with the specified timeout and return a object that can be used to track the state of the timer and cancel it if need be.- Parameters:
clientExecutionTimeoutMillis- A positive value here enables the timer, a non-positive value disables it and returns a dummy tracker task- Returns:
- Implementation of
ClientExecutionAbortTrackerTaskImplto query the state of the task, provide it with up to date context, and cancel it if appropriate
-
getExecutor
public ScheduledThreadPoolExecutor getExecutor()
This method is current exposed for testing purposes- Returns:
- The underlying
ScheduledThreadPoolExecutor
-
shutdown
public void shutdown()
Shutdown the underlyingScheduledThreadPoolExecutor. Should be invoked whenAmazonHttpClientis shutdown
-
-