Package org.apache.http.impl.client
Class NullBackoffStrategy
- java.lang.Object
-
- org.apache.http.impl.client.NullBackoffStrategy
-
- All Implemented Interfaces:
ConnectionBackoffStrategy
public class NullBackoffStrategy extends java.lang.Object implements ConnectionBackoffStrategy
This is aConnectionBackoffStrategythat never backs off, for compatibility with existing behavior.- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description NullBackoffStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanshouldBackoff(java.lang.Throwable t)Determines whether seeing the givenThrowableas a result of request execution should result in a backoff signal.booleanshouldBackoff(HttpResponse resp)Determines whether receiving the givenHttpResponseas a result of request execution should result in a backoff signal.
-
-
-
Method Detail
-
shouldBackoff
public boolean shouldBackoff(java.lang.Throwable t)
Description copied from interface:ConnectionBackoffStrategyDetermines whether seeing the givenThrowableas a result of request execution should result in a backoff signal.- Specified by:
shouldBackoffin interfaceConnectionBackoffStrategy- Parameters:
t- theThrowablethat happened- Returns:
trueif a backoff signal should be given
-
shouldBackoff
public boolean shouldBackoff(HttpResponse resp)
Description copied from interface:ConnectionBackoffStrategyDetermines whether receiving the givenHttpResponseas a result of request execution should result in a backoff signal. Implementations MUST restrict themselves to examining the response header and MUST NOT consume any of the response body, if any.- Specified by:
shouldBackoffin interfaceConnectionBackoffStrategy- Parameters:
resp- theHttpResponsethat was received- Returns:
trueif a backoff signal should be given
-
-