com.healthmarketscience.rmiio
Class RemoteRetry.Simple

java.lang.Object
  extended by com.healthmarketscience.rmiio.RemoteRetry
      extended by 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).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.healthmarketscience.rmiio.RemoteRetry
RemoteRetry.Always, RemoteRetry.Caller<RetType>, RemoteRetry.Never, RemoteRetry.Simple, RemoteRetry.SimpleAlways, RemoteRetry.VoidCaller
 
Field Summary
static int DEFAULT_NUM_MAX_RETRIES
          default number of times to retry
 
Fields inherited from class com.healthmarketscience.rmiio.RemoteRetry
LOG, NEVER, RUNTIME_CLASS, SIMPLE, SIMPLE_ALWAYS
 
Constructor Summary
RemoteRetry.Simple()
           
RemoteRetry.Simple(int maxNumRetries)
           
 
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 com.healthmarketscience.rmiio.RemoteRetry
call, call, call, call, call, call, call, call, callImpl, simpleBackOff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NUM_MAX_RETRIES

public static final int DEFAULT_NUM_MAX_RETRIES
default number of times to retry

See Also:
Constant Field Values
Constructor Detail

RemoteRetry.Simple

public RemoteRetry.Simple()

RemoteRetry.Simple

public RemoteRetry.Simple(int maxNumRetries)
Method Detail

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 thrown
numRetries - 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 reattempts
log - debug log


Copyright © 2006-2009 Health Market Science. All Rights Reserved.