ch.elca.el4j.services.exceptionhandler.handler
Class RetryExceptionHandler

java.lang.Object
  extended by ch.elca.el4j.services.exceptionhandler.handler.AbstractExceptionHandler
      extended by ch.elca.el4j.services.exceptionhandler.handler.AbstractRetryExceptionHandler
          extended by ch.elca.el4j.services.exceptionhandler.handler.RetryExceptionHandler
All Implemented Interfaces:
ExceptionHandler

public class RetryExceptionHandler
extends AbstractRetryExceptionHandler

This class implements an exception handler that tries to call the target several times after waiting a configurable delay.

Author:
Andreas Bur (ABU)
File-location:
RetryExceptionHandler
Last check-in date:
2009-08-04 15:35:01 +0200 (Di, 04. Aug 2009) by swismer for revision 3883

Constructor Summary
RetryExceptionHandler()
           
 
Method Summary
protected  Object retry(Throwable t, AbstractExceptionHandlerInterceptor exceptionInvoker, org.aopalliance.intercept.MethodInvocation invocation, org.slf4j.Logger logger)
          Creates a new retry exception.
 void setSleepMillis(int sleepMillis)
          Sets the amount of time in milli seconds between two successive invocations.
 
Methods inherited from class ch.elca.el4j.services.exceptionhandler.handler.AbstractRetryExceptionHandler
getRetries, handleException, setRetries
 
Methods inherited from class ch.elca.el4j.services.exceptionhandler.handler.AbstractExceptionHandler
getInvocationDescription, handleException, setUseDynamicLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryExceptionHandler

public RetryExceptionHandler()
Method Detail

setSleepMillis

public void setSleepMillis(int sleepMillis)
Sets the amount of time in milli seconds between two successive invocations.

Parameters:
sleepMillis - The time in milli seconds to wait.

retry

protected Object retry(Throwable t,
                       AbstractExceptionHandlerInterceptor exceptionInvoker,
                       org.aopalliance.intercept.MethodInvocation invocation,
                       org.slf4j.Logger logger)
                throws Throwable
Creates a new retry exception. Subclasses may also do some other tasks (e.g. waiting). This method is called only if the number of retires is not already exceeded.

Specified by:
retry in class AbstractRetryExceptionHandler
Parameters:
t - The exception thrown in the method invocation.
exceptionInvoker - The exception invoker that called this exception handler.
invocation - The original method invocation.
logger - The logger to be used by subclasses.
Returns:
Returns an object that is treated as the original invocation's return value.
Throws:
Throwable - Whenever something goes wrong.


Copyright © 2005-2011 ELCA. All Rights Reserved.