org.multiverse.utils.backoff
Class NoOpBackoffPolicy

java.lang.Object
  extended by org.multiverse.utils.backoff.NoOpBackoffPolicy
All Implemented Interfaces:
BackoffPolicy

public class NoOpBackoffPolicy
extends java.lang.Object
implements BackoffPolicy

A BackoffPolicy that does not backoff. This implementation is useful a BackoffPolicy instance is needed, but no delay should be executed.

Author:
Peter Veentjer.

Field Summary
static NoOpBackoffPolicy INSTANCE
           
 
Constructor Summary
NoOpBackoffPolicy()
           
 
Method Summary
 void delay(Transaction t, int attempt)
          Executes the delay.
 void delayedUninterruptible(Transaction t, int attempt)
          Executes the delay without the possibility of being interrupted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NoOpBackoffPolicy INSTANCE
Constructor Detail

NoOpBackoffPolicy

public NoOpBackoffPolicy()
Method Detail

delay

public void delay(Transaction t,
                  int attempt)
           throws java.lang.InterruptedException
Description copied from interface: BackoffPolicy
Executes the delay. This call is interruptible.

Specified by:
delay in interface BackoffPolicy
Parameters:
t - the transaction that is going to be restarted. The transaction should never be null, but it depends on the implementation if this is checked.
attempt - indicates the number of times the transaction is tried. Attempt should always be equal or larger than 1. It depends on the implementation if this is checked.
Throws:
java.lang.InterruptedException - if the delay is interrupted.

delayedUninterruptible

public void delayedUninterruptible(Transaction t,
                                   int attempt)
Description copied from interface: BackoffPolicy
Executes the delay without the possibility of being interrupted.

Specified by:
delayedUninterruptible in interface BackoffPolicy
Parameters:
t - the transaction that is going to be restarted. The transaction should never be null, but it depends on the implementation if this is checked.
attempt - indicates the number of times the transaction is tried. Attempt should always be equal or larger than 1. It depends on the implementation if this is checked.


Copyright © 2008-2010 Multiverse. All Rights Reserved.