public class FutureRetryContext extends Object implements RetryContext
RetryContext
to be used when a RetryPolicyTemplate
is
executed in a separate thread via the AsynchronousRetryTemplate
. A FutureRetryContext is a proxy to a real
RetryContext
and provides access to the real context once it becomes available.FAILED_DISPATCHER, FAILED_RECEIVER, FAILED_REQUESTER
Constructor and Description |
---|
FutureRetryContext() |
Modifier and Type | Method and Description |
---|---|
void |
addReturnMessage(MuleMessage result) |
protected void |
checkState() |
String |
getDescription() |
MuleMessage |
getFirstReturnMessage() |
Throwable |
getLastFailure()
The most recent failure which prevented the context from validating the connection.
|
Map<Object,Object> |
getMetaInfo() |
MuleContext |
getMuleContext() |
MuleMessage[] |
getReturnMessages() |
boolean |
isOk()
Note that it's possible for an implementation to return false and have no failure specified, thus
the subsequent
RetryContext.getLastFailure() may return null. |
boolean |
isReady() |
void |
setFailed(Throwable lastFailure)
Typically called by validation logic to mark a problem and an optional root cause.
|
void |
setOk()
Typically called by validation logic to mark no problems with the current connection.
|
void |
setReturnMessages(MuleMessage[] returnMessages) |
public boolean isReady()
protected void checkState()
public void addReturnMessage(MuleMessage result)
addReturnMessage
in interface RetryContext
public String getDescription()
getDescription
in interface RetryContext
public MuleMessage getFirstReturnMessage()
getFirstReturnMessage
in interface RetryContext
public Map<Object,Object> getMetaInfo()
getMetaInfo
in interface RetryContext
public MuleMessage[] getReturnMessages()
getReturnMessages
in interface RetryContext
public void setReturnMessages(MuleMessage[] returnMessages)
setReturnMessages
in interface RetryContext
public Throwable getLastFailure()
RetryContext
RetryContext.isOk()
should be consulted first.getLastFailure
in interface RetryContext
public void setOk()
RetryContext
setOk
in interface RetryContext
public void setFailed(Throwable lastFailure)
RetryContext
setFailed
in interface RetryContext
lastFailure
- the most recent failure, can be nullpublic boolean isOk()
RetryContext
RetryContext.getLastFailure()
may return null.isOk
in interface RetryContext
public MuleContext getMuleContext()
getMuleContext
in interface RetryContext
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.