com.netflix.astyanax.retry
Class RetryNTimes

java.lang.Object
  extended by com.netflix.astyanax.retry.RetryNTimes
All Implemented Interfaces:
RetryPolicy

public class RetryNTimes
extends Object
implements RetryPolicy


Constructor Summary
RetryNTimes(int max)
           
 
Method Summary
 boolean allowRetry()
          Ask the policy if a retry is allowed.
 void begin()
          Operation is starting
 RetryPolicy duplicate()
          Duplicate this policy into a fresh instance
 void failure(Exception e)
          Operation has failed
 int getAttemptCount()
          Return the number of attempts since begin was called
 void success()
          Operation has completed successfully
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RetryNTimes

public RetryNTimes(int max)
Method Detail

begin

public void begin()
Description copied from interface: RetryPolicy
Operation is starting

Specified by:
begin in interface RetryPolicy

success

public void success()
Description copied from interface: RetryPolicy
Operation has completed successfully

Specified by:
success in interface RetryPolicy

failure

public void failure(Exception e)
Description copied from interface: RetryPolicy
Operation has failed

Specified by:
failure in interface RetryPolicy

allowRetry

public boolean allowRetry()
Description copied from interface: RetryPolicy
Ask the policy if a retry is allowed. This may internally sleep

Specified by:
allowRetry in interface RetryPolicy
Returns:

getAttemptCount

public int getAttemptCount()
Description copied from interface: RetryPolicy
Return the number of attempts since begin was called

Specified by:
getAttemptCount in interface RetryPolicy
Returns:

duplicate

public RetryPolicy duplicate()
Description copied from interface: RetryPolicy
Duplicate this policy into a fresh instance

Specified by:
duplicate in interface RetryPolicy
Returns:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.