org.mule.routing
Class UntilSuccessful

java.lang.Object
  extended by org.mule.processor.AbstractMuleObjectOwner<MessageProcessor>
      extended by org.mule.processor.AbstractMessageProcessorOwner
          extended by org.mule.routing.outbound.AbstractOutboundRouter
              extended by org.mule.routing.UntilSuccessful
All Implemented Interfaces:
AnnotatedObject, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, MessageProcessor, MessageRouter, Matchable, MatchableMessageProcessor, MatchableMessageRouter, OutboundRouter, RouterStatisticsRecorder

public class UntilSuccessful
extends AbstractOutboundRouter

UntilSuccessful attempts to route a message to the message processor it contains in an asynchronous manner. Routing is considered successful if no exception has been raised and, optionally, if the response matches an expression. UntilSuccessful can optionally be configured to synchronously return an acknowledgment message when it has scheduled the event for processing. UntilSuccessful is backed by a ListableObjectStore for storing the events that are pending (re)processing.


Field Summary
static String PROCESS_ATTEMPT_COUNT_PROPERTY_NAME
           
 
Fields inherited from class org.mule.routing.outbound.AbstractOutboundRouter
enableCorrelation, initialised, logger, magicProperties, replyTo, resultsHandler, routes, started, transactionConfig
 
Fields inherited from class org.mule.processor.AbstractMuleObjectOwner
flowConstruct, muleContext
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
UntilSuccessful()
           
 
Method Summary
static Serializable buildQueueKey(MuleEvent muleEvent)
           
 String getAckExpression()
           
 Object getDeadLetterQueue()
           
 String getEventKeyPrefix()
           
 String getFailureExpression()
           
 ExpressionFilter getFailureExpressionFilter()
           
 int getMaxRetries()
           
 ListableObjectStore<MuleEvent> getObjectStore()
           
 long getSecondsBetweenRetries()
           
 void initialise()
          Method used to perform any initialisation work.
 boolean isMatch(MuleMessage message)
          Determines if the event should be processed
protected  MuleEvent route(MuleEvent event)
           
 void setAckExpression(String ackExpression)
           
 void setDeadLetterQueue(Object deadLetterQueue)
           
 void setFailureExpression(String failureExpression)
           
 void setMaxRetries(int maxRetries)
           
 void setObjectStore(ListableObjectStore<MuleEvent> objectStore)
           
 void setSecondsBetweenRetries(long secondsBetweenRetries)
           
 void start()
           
 
Methods inherited from class org.mule.routing.outbound.AbstractOutboundRouter
addRoute, cloneMessage, createEventToRoute, dispose, getEnableCorrelation, getMuleContext, getOwnedMessageProcessors, getReplyTo, getResultsHandler, getRoute, getRouterStatistics, getRoutes, getTransactionConfig, isDynamicRoutes, process, propagateMagicProperties, removeRoute, sendRequest, sendRequestEvent, setEnableCorrelation, setEnableCorrelationAsString, setMessageProcessors, setMessageProperties, setReplyTo, setResultsHandler, setRouterStatistics, setRoutes, setTransactionConfig, stop
 
Methods inherited from class org.mule.processor.AbstractMessageProcessorOwner
getAnnotation, getAnnotations, getOwnedObjects, setAnnotations
 
Methods inherited from class org.mule.processor.AbstractMuleObjectOwner
getFlowConstruct, setFlowConstruct, setMuleContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.api.construct.FlowConstructAware
setFlowConstruct
 

Field Detail

PROCESS_ATTEMPT_COUNT_PROPERTY_NAME

public static final String PROCESS_ATTEMPT_COUNT_PROPERTY_NAME
See Also:
Constant Field Values
Constructor Detail

UntilSuccessful

public UntilSuccessful()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Overrides:
initialise in class AbstractOutboundRouter
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

start

public void start()
           throws MuleException
Specified by:
start in interface Startable
Overrides:
start in class AbstractOutboundRouter
Throws:
MuleException

isMatch

public boolean isMatch(MuleMessage message)
                throws MuleException
Description copied from interface: Matchable
Determines if the event should be processed

Parameters:
message - the current message to evaluate
Returns:
true if the event should be processed by this router
Throws:
MuleException - if the event cannot be evaluated

route

protected MuleEvent route(MuleEvent event)
                   throws MessagingException
Specified by:
route in class AbstractOutboundRouter
Throws:
MessagingException

buildQueueKey

public static Serializable buildQueueKey(MuleEvent muleEvent)

getObjectStore

public ListableObjectStore<MuleEvent> getObjectStore()

setObjectStore

public void setObjectStore(ListableObjectStore<MuleEvent> objectStore)

getMaxRetries

public int getMaxRetries()

setMaxRetries

public void setMaxRetries(int maxRetries)

getSecondsBetweenRetries

public long getSecondsBetweenRetries()

setSecondsBetweenRetries

public void setSecondsBetweenRetries(long secondsBetweenRetries)

getFailureExpression

public String getFailureExpression()

setFailureExpression

public void setFailureExpression(String failureExpression)

getAckExpression

public String getAckExpression()

setAckExpression

public void setAckExpression(String ackExpression)

setDeadLetterQueue

public void setDeadLetterQueue(Object deadLetterQueue)

getDeadLetterQueue

public Object getDeadLetterQueue()

getEventKeyPrefix

public String getEventKeyPrefix()

getFailureExpressionFilter

public ExpressionFilter getFailureExpressionFilter()


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