org.ow2.orchestra.pvm.internal.svc
Class RetryInterceptor
java.lang.Object
org.ow2.orchestra.pvm.internal.svc.Interceptor
org.ow2.orchestra.pvm.internal.svc.RetryInterceptor
- All Implemented Interfaces:
- CommandService
public class RetryInterceptor
- extends Interceptor
retries the command execution in case hibernate throws optimistic locking
(StaleObjectException) exceptions.
- Author:
- Tom Baeyens
| Fields inherited from class org.ow2.orchestra.pvm.internal.svc.Interceptor |
next |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RetryInterceptor
public RetryInterceptor()
execute
public <T> T execute(Command<T> command)
shouldRetry
protected boolean shouldRetry(Command<?> command,
RuntimeException e)
getRetries
public int getRetries()
setRetries
public void setRetries(int retries)
getDelay
public long getDelay()
setDelay
public void setDelay(long delay)
getDelayFactor
public int getDelayFactor()
setDelayFactor
public void setDelayFactor(int delayFactor)
getMaxDelay
public long getMaxDelay()
- Returns:
- the maxDelay
setMaxDelay
public void setMaxDelay(long maxDelay)
- Parameters:
maxDelay - the maxDelay to set
getRandom
public static Random getRandom()
- Returns:
- the random
Copyright © 2011 OW2 Consortium. All Rights Reserved.