public final class AsynchronousRetryTemplate extends AbstractComponent implements RetryPolicyTemplate
RetryPolicyTemplate
and will execute any retry work within a separate thread. An optional
Latch
can be passed into this template, in which case execution will only occur once the latch is released.LOCATION_KEY, ROOT_CONTAINER_NAME_KEY
ANNOTATIONS_PROPERTY_NAME
Constructor and Description |
---|
AsynchronousRetryTemplate(RetryPolicyTemplate delegate) |
Modifier and Type | Method and Description |
---|---|
RetryPolicy |
createRetryInstance() |
RetryContext |
execute(RetryCallback callback,
Executor workManager)
Applies the retry policy by performing a blocking action.
|
RetryPolicyTemplate |
getDelegate() |
Map<Object,Object> |
getMetaInfo() |
RetryNotifier |
getNotifier() |
void |
setMetaInfo(Map<Object,Object> metaInfo) |
void |
setNotifier(RetryNotifier retryNotifier) |
void |
setStartLatch(Latch latch) |
getAnnotation, getAnnotations, getLocation, getRootContainerLocation, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyPolicy, applyPolicy
public AsynchronousRetryTemplate(RetryPolicyTemplate delegate)
public RetryContext execute(RetryCallback callback, Executor workManager) throws Exception
RetryPolicyTemplate
execute
in interface RetryPolicyTemplate
callback
- a callback with the logic to be executed on each retryworkManager
- the executor on which the retry operations are to be executedRetryContext
Exception
public RetryPolicy createRetryInstance()
createRetryInstance
in interface RetryPolicyTemplate
public RetryNotifier getNotifier()
getNotifier
in interface RetryPolicyTemplate
public void setNotifier(RetryNotifier retryNotifier)
setNotifier
in interface RetryPolicyTemplate
public Map<Object,Object> getMetaInfo()
getMetaInfo
in interface RetryPolicyTemplate
public void setMetaInfo(Map<Object,Object> metaInfo)
setMetaInfo
in interface RetryPolicyTemplate
public RetryPolicyTemplate getDelegate()
public void setStartLatch(Latch latch)
Copyright © 2018. All rights reserved.