public class SpecificTaskRetryPolicy extends Object implements ServiceRetryPolicy
SpecificTaskServiceLocator.
Returns true from retryHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse) when encountering an HTTP 400 or HTTP 404 with a
ChatHandlerResource.TASK_ID_HEADER header for a different task. This can happen when a task is suspended and
then later restored in a different location, and then some *other* task reuses its old port. This task-mismatch
scenario is retried indefinitely, since we expect that the SpecificTaskServiceLocator will update the
location at some point.UNLIMITED| Constructor and Description |
|---|
SpecificTaskRetryPolicy(String taskId,
ServiceRetryPolicy baseRetryPolicy) |
| Modifier and Type | Method and Description |
|---|---|
long |
maxAttempts()
Returns the maximum number of desired attempts, or
ServiceRetryPolicy.UNLIMITED if unlimited. |
long |
maxWaitMillis()
Returns the maximum wait time between retries.
|
long |
minWaitMillis()
Returns the minimum wait time between retries.
|
boolean |
retryHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse response)
Returns whether the given HTTP response can be retried.
|
boolean |
retryNotAvailable()
Returns whether service-not-available, i.e.
|
boolean |
retryThrowable(Throwable t)
Returns whether the given exception can be retried.
|
public SpecificTaskRetryPolicy(String taskId, ServiceRetryPolicy baseRetryPolicy)
public long maxAttempts()
ServiceRetryPolicyServiceRetryPolicy.UNLIMITED if unlimited. A value of 1 means no retries.
Zero is invalid.maxAttempts in interface ServiceRetryPolicypublic long minWaitMillis()
ServiceRetryPolicyminWaitMillis in interface ServiceRetryPolicypublic long maxWaitMillis()
ServiceRetryPolicymaxWaitMillis in interface ServiceRetryPolicypublic boolean retryHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse response)
ServiceRetryPolicyretryHttpResponse in interface ServiceRetryPolicypublic boolean retryThrowable(Throwable t)
ServiceRetryPolicyretryThrowable in interface ServiceRetryPolicypublic boolean retryNotAvailable()
ServiceRetryPolicyServiceLocations.getLocations(), can be retried.retryNotAvailable in interface ServiceRetryPolicyCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.