org.mule.providers
Class SimpleRetryConnectionStrategy

java.lang.Object
  extended byorg.mule.providers.AbstractConnectionStrategy
      extended byorg.mule.providers.SimpleRetryConnectionStrategy
All Implemented Interfaces:
ConnectionStrategy

public class SimpleRetryConnectionStrategy
extends AbstractConnectionStrategy

A simple connection retry strategy where the a connection will be attempted X number of retryCount every Y milliseconds. The retryCount and frequency properties can be set to customise the behaviour.


Nested Class Summary
protected static class SimpleRetryConnectionStrategy.RetryCounter
           
 
Field Summary
protected static ThreadLocal called
           
static int DEFAULT_FREQUENCY
           
static int DEFAULT_RETRY_COUNT
           
static int RETRY_COUNT_FOREVER
           
protected static SimpleRetryConnectionStrategy.RetryCounter retryCounter
           
 
Fields inherited from class org.mule.providers.AbstractConnectionStrategy
logger
 
Constructor Summary
SimpleRetryConnectionStrategy()
           
 
Method Summary
protected  void doConnect(UMOConnectable connectable)
           
 long getFrequency()
           
 int getRetryCount()
           
 void resetState()
          Resets any state stored in the retry strategy
 void setFrequency(long frequency)
           
 void setRetryCount(int retryCount)
          How many times to retry.
 
Methods inherited from class org.mule.providers.AbstractConnectionStrategy
connect, getDescription, isDoThreading, setDoThreading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FREQUENCY

public static final int DEFAULT_FREQUENCY
See Also:
Constant Field Values

DEFAULT_RETRY_COUNT

public static final int DEFAULT_RETRY_COUNT
See Also:
Constant Field Values

RETRY_COUNT_FOREVER

public static final int RETRY_COUNT_FOREVER
See Also:
Constant Field Values

retryCounter

protected static final SimpleRetryConnectionStrategy.RetryCounter retryCounter

called

protected static final ThreadLocal called
Constructor Detail

SimpleRetryConnectionStrategy

public SimpleRetryConnectionStrategy()
Method Detail

doConnect

protected void doConnect(UMOConnectable connectable)
                  throws FatalConnectException
Specified by:
doConnect in class AbstractConnectionStrategy
Throws:
FatalConnectException

resetState

public void resetState()
Resets any state stored in the retry strategy

Specified by:
resetState in class AbstractConnectionStrategy

getRetryCount

public int getRetryCount()

setRetryCount

public void setRetryCount(int retryCount)
How many times to retry. Set to -1 to retry forever.

Parameters:
retryCount - number of retries

getFrequency

public long getFrequency()

setFrequency

public void setFrequency(long frequency)


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