List of usage examples for org.springframework.aop.framework ReflectiveMethodInvocation invocableClone
@Override
public MethodInvocation invocableClone()
From source file:net.chrisrichardson.foodToGo.util.spring.TransactionRetryInterceptor.java
public Object invoke(MethodInvocation invocation) throws Throwable { int retryCount = 0; while (true)/* w w w . j av a2 s . co m*/ try { ReflectiveMethodInvocation inv = (ReflectiveMethodInvocation) invocation; MethodInvocation anotherInvocation = inv.invocableClone(); return anotherInvocation.proceed(); } catch (ConcurrencyFailureException e) { if (retryCount++ > maxRetryCount) throw e; else { cleanupBeforeRetrying(); continue; } } }