org.jbpm.pvm.internal.svc
Class RetryInterceptor

java.lang.Object
  extended by org.jbpm.pvm.internal.svc.Interceptor
      extended by org.jbpm.pvm.internal.svc.RetryInterceptor
All Implemented Interfaces:
CommandService
Direct Known Subclasses:
JtaRetryInterceptor

public class RetryInterceptor
extends Interceptor

retries the command execution in case hibernate throws optimistic locking (StaleObjectException) exceptions.

Author:
Tom Baeyens, Huisheng Xu

Field Summary
 
Fields inherited from class org.jbpm.pvm.internal.svc.Interceptor
next
 
Fields inherited from interface org.jbpm.pvm.internal.cmd.CommandService
NAME_NEW_TX_REQUIRED_COMMAND_SERVICE, NAME_TX_REQUIRED_COMMAND_SERVICE
 
Constructor Summary
RetryInterceptor()
           
 
Method Summary
<T> T
execute(Command<T> command)
           
 long getDelay()
           
 long getDelayFactor()
           
 int getRetries()
           
protected  boolean isCausedByOptimisticLockingFailure(java.lang.Throwable throwable)
          fix for JBPM-2864.
 void setDelay(long delay)
           
 void setDelayFactor(long delayFactor)
           
 void setRetries(int retries)
           
 
Methods inherited from class org.jbpm.pvm.internal.svc.Interceptor
getNext, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryInterceptor

public RetryInterceptor()
Method Detail

execute

public <T> T execute(Command<T> command)

isCausedByOptimisticLockingFailure

protected boolean isCausedByOptimisticLockingFailure(java.lang.Throwable throwable)
fix for JBPM-2864. If this exception is caused by StaleStateException, then we should retry.


getRetries

public int getRetries()

setRetries

public void setRetries(int retries)

getDelay

public long getDelay()

setDelay

public void setDelay(long delay)

getDelayFactor

public long getDelayFactor()

setDelayFactor

public void setDelayFactor(long delayFactor)


Copyright © 2010 JBoss Community. All Rights Reserved.