public class RetryInterceptor extends CommandInterceptor
OptimisticLockingException
and tries to run the
same command again. The number of retries and the time waited between retries
is configurable.Modifier and Type | Field and Description |
---|---|
protected int |
numOfRetries |
protected int |
waitIncreaseFactor |
protected int |
waitTimeInMs |
next
Constructor and Description |
---|
RetryInterceptor() |
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(Command<T> command) |
int |
getNumOfRetries() |
int |
getWaitIncreaseFactor() |
int |
getWaitTimeInMs() |
void |
setNumOfRetries(int numOfRetries) |
void |
setWaitIncreaseFactor(int waitIncreaseFactor) |
void |
setWaitTimeInMs(int waitTimeInMs) |
protected void |
waitBeforeRetry(long waitTime) |
getNext, setNext
protected int numOfRetries
protected int waitTimeInMs
protected int waitIncreaseFactor
public <T> T execute(Command<T> command)
protected void waitBeforeRetry(long waitTime)
public void setNumOfRetries(int numOfRetries)
public void setWaitIncreaseFactor(int waitIncreaseFactor)
public void setWaitTimeInMs(int waitTimeInMs)
public int getNumOfRetries()
public int getWaitIncreaseFactor()
public int getWaitTimeInMs()
Copyright © 2015. All rights reserved.