com.healthmarketscience.rmiio
Class RemoteRetry.Simple
java.lang.Object
com.healthmarketscience.rmiio.RemoteRetry
com.healthmarketscience.rmiio.RemoteRetry.Simple
- Enclosing class:
- RemoteRetry
public static class RemoteRetry.Simple
- extends RemoteRetry
Simple implementation of RemoteRetry which retries RemoteExceptions some
number of times and uses the backoff strategy from
RemoteRetry.simpleBackOff(int, org.apache.commons.logging.Log).
|
Method Summary |
void |
backOff(int numRetries,
org.apache.commons.logging.Log log)
Should delay for some implementation defined amount of time (to give the
callee, network, etc. |
int |
getMaxNumRetries()
|
boolean |
shouldRetry(Throwable t,
int numRetries)
Returns true if the caller should attempt to repeat the
current remote method call given the number of previous reattempts. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_NUM_MAX_RETRIES
public static final int DEFAULT_NUM_MAX_RETRIES
- default number of times to retry
- See Also:
- Constant Field Values
RemoteRetry.Simple
public RemoteRetry.Simple()
RemoteRetry.Simple
public RemoteRetry.Simple(int maxNumRetries)
getMaxNumRetries
public int getMaxNumRetries()
shouldRetry
public boolean shouldRetry(Throwable t,
int numRetries)
- Description copied from class:
RemoteRetry
- Returns
true if the caller should attempt to repeat the
current remote method call given the number of previous reattempts.
- Specified by:
shouldRetry in class RemoteRetry
- Parameters:
t - throwable thrownnumRetries - number of previous reattempts
- Returns:
true iff call should be repeated, true
otherwise
backOff
public void backOff(int numRetries,
org.apache.commons.logging.Log log)
- Description copied from class:
RemoteRetry
- Should delay for some implementation defined amount of time (to give the
callee, network, etc. time to recover) given the number of previous
reattempts. Will be called iff shouldRetry() returned
true.
Good implementations should implement some sort of increased delay
based on the number of reattempts.
- Specified by:
backOff in class RemoteRetry
- Parameters:
numRetries - number of previous reattemptslog - debug log
Copyright © 2006-2009 Health Market Science. All Rights Reserved.