com.netflix.astyanax.retry
Class RunOnce

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

public class RunOnce
extends Object
implements RetryPolicy


Field Summary
static RunOnce instance
           
 
Constructor Summary
RunOnce()
           
 
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
static RunOnce get()
           
 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
 

Field Detail

instance

public static RunOnce instance
Constructor Detail

RunOnce

public RunOnce()
Method Detail

get

public static RunOnce get()

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.