1 /*
2 * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 package com.amazonaws.http.timers.client;
16
17 import org.apache.http.client.methods.HttpRequestBase;
18
19 /**
20 * Dummy implementation of {@link ClientExecutionAbortTrackerTask} used when the timer is disabled
21 * for a request
22 */
23 public class NoOpClientExecutionAbortTrackerTask implements ClientExecutionAbortTrackerTask {
24
25 public static final NoOpClientExecutionAbortTrackerTask INSTANCE = new NoOpClientExecutionAbortTrackerTask();
26
27 // Singleton
28 private NoOpClientExecutionAbortTrackerTask() {
29 }
30
31 @Override
32 public void setCurrentHttpRequest(HttpRequestBase newRequest) {
33 }
34
35 @Override
36 public boolean hasTimeoutExpired() {
37 return false;
38 }
39
40 @Override
41 public boolean isEnabled() {
42 return false;
43 }
44
45 @Override
46 public void cancelTask() {
47 }
48
49 }
50