|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BackoffPolicy
A policy that can be used to backoff when it can't make progress because other transactions are interfering. A lot of interference means that there is a lot of contention and with a backoff policy it means that you can reduce contention by delaying certain transactions, so that the chance increases for some of them to make progress and eventually make the way free for the others.
ThedelayedUninterruptible(org.multiverse.api.Transaction) needs the transaction, so that different
dalays can be done based on the transaction. For example a transaction that has a higher priority could get a smaller
delay than a transaction with a lower priority.
Interruptable and non interruptable delay methods are provided.
| Method Summary | |
|---|---|
void |
delay(Transaction tx)
Executes the delay. |
void |
delayedUninterruptible(Transaction tx)
Executes the delay without the possibility of being interrupted. |
| Method Detail |
|---|
void delay(Transaction tx)
throws java.lang.InterruptedException
tx - the transaction that is going to be restarted. The transaction should never be null, but it
depends on the implementation if this is checked.
java.lang.NullPointerException - if t is null. It depends on the implementation if this is checked.
java.lang.IllegalArgumentException - if attempt smaller than 1. It depends on the implementation if this is checked.
java.lang.InterruptedException - if the delay is interrupted.void delayedUninterruptible(Transaction tx)
tx - the transaction that is going to be restarted. The transaction should never be null, but it
depends on the implementation if this is checked.
java.lang.NullPointerException - if t is null. It depends on the implementation if this is checked.
java.lang.IllegalArgumentException - if attempt smaller than 1. It depends on the implementation if this is checked.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||