org.mule.retry.async
Class FutureRetryContext

java.lang.Object
  extended by org.mule.retry.async.FutureRetryContext
All Implemented Interfaces:
RetryContext

public class FutureRetryContext
extends Object
implements RetryContext

An implementation of 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.


Field Summary
 
Fields inherited from interface org.mule.api.retry.RetryContext
FAILED_DISPATCHER, FAILED_RECEIVER, FAILED_REQUESTER
 
Constructor Summary
FutureRetryContext()
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FutureRetryContext

public FutureRetryContext()
Method Detail

isReady

public boolean isReady()

checkState

protected void checkState()

addReturnMessage

public void addReturnMessage(MuleMessage result)
Specified by:
addReturnMessage in interface RetryContext

getDescription

public String getDescription()
Specified by:
getDescription in interface RetryContext

getFirstReturnMessage

public MuleMessage getFirstReturnMessage()
Specified by:
getFirstReturnMessage in interface RetryContext

getMetaInfo

public Map<Object,Object> getMetaInfo()
Specified by:
getMetaInfo in interface RetryContext
Returns:
a read-only meta-info map or an empty map, never null.

getReturnMessages

public MuleMessage[] getReturnMessages()
Specified by:
getReturnMessages in interface RetryContext

setReturnMessages

public void setReturnMessages(MuleMessage[] returnMessages)
Specified by:
setReturnMessages in interface RetryContext

getLastFailure

public Throwable getLastFailure()
Description copied from interface: RetryContext
The most recent failure which prevented the context from validating the connection. Note that the method may return null. Instead, the RetryContext.isOk() should be consulted first.

Specified by:
getLastFailure in interface RetryContext
Returns:
last failure or null

setOk

public void setOk()
Description copied from interface: RetryContext
Typically called by validation logic to mark no problems with the current connection. Additionally, clears any previous failure set.

Specified by:
setOk in interface RetryContext

setFailed

public void setFailed(Throwable lastFailure)
Description copied from interface: RetryContext
Typically called by validation logic to mark a problem and an optional root cause.

Specified by:
setFailed in interface RetryContext
Parameters:
lastFailure - the most recent failure, can be null

isOk

public boolean isOk()
Description copied from interface: RetryContext
Note that it's possible for an implementation to return false and have no failure specified, thus the subsequent RetryContext.getLastFailure() may return null.

Specified by:
isOk in interface RetryContext
Returns:
true if no problems detected before

getMuleContext

public MuleContext getMuleContext()
Specified by:
getMuleContext in interface RetryContext


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.