org.mule.api.retry
Interface RetryContext

All Known Implementing Classes:
DefaultRetryContext

public interface RetryContext

The RetryContext is used to store any data which carries over from attempt to attempt such as response messages.


Field Summary
static String FAILED_DISPATCHER
           
static String FAILED_RECEIVER
           
static String FAILED_REQUESTER
           
 
Method Summary
 void addReturnMessage(MuleMessage result)
           
 String getDescription()
           
 MuleMessage getFirstReturnMessage()
           
 Throwable getLastFailure()
          The most recent failure which prevented the context from validating the connection.
 Map getMetaInfo()
           
 MuleMessage[] getReturnMessages()
           
 boolean isOk()
          Note that it's possible for an implementation to return false and have no failure specified, thus the subsequent getLastFailure() may return null.
 void setFailed(Throwable lastFailure)
          Typically called by validation logic to mark a problem and an optional root cause.
 void setMetaInfo(Map metaInfo)
           
 void setOk()
          Typically called by validation logic to mark no problems with the current connection.
 void setReturnMessages(MuleMessage[] returnMessages)
           
 

Field Detail

FAILED_RECEIVER

static final String FAILED_RECEIVER
See Also:
Constant Field Values

FAILED_DISPATCHER

static final String FAILED_DISPATCHER
See Also:
Constant Field Values

FAILED_REQUESTER

static final String FAILED_REQUESTER
See Also:
Constant Field Values
Method Detail

getMetaInfo

Map getMetaInfo()
Returns:
a read-only meta-info map or an empty map, never null.

setMetaInfo

void setMetaInfo(Map metaInfo)

getReturnMessages

MuleMessage[] getReturnMessages()

getFirstReturnMessage

MuleMessage getFirstReturnMessage()

setReturnMessages

void setReturnMessages(MuleMessage[] returnMessages)

addReturnMessage

void addReturnMessage(MuleMessage result)

getDescription

String getDescription()

getLastFailure

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

Returns:
last failure or null

setOk

void setOk()
Typically called by validation logic to mark no problems with the current connection. Additionally, clears any previous failure set.


setFailed

void setFailed(Throwable lastFailure)
Typically called by validation logic to mark a problem and an optional root cause.

Parameters:
lastFailure - the most recent failure, can be null

isOk

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

Returns:
true if no problems detected before


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.