1   //package net.secodo.jcircuitbreaker.breaker.impl;
2   //
3   //import net.secodo.jcircuitbreaker.breaker.execution.ExecutionContext;
4   //import net.secodo.jcircuitbreaker.breakhandler.BreakHandler;
5   //import net.secodo.jcircuitbreaker.breakhandler.exception.BreakHandlerException;
6   //import net.secodo.jcircuitbreaker.breakstrategy.BreakStrategy;
7   //import net.secodo.jcircuitbreaker.exception.CircuitBreakerException;
8   //import net.secodo.jcircuitbreaker.exception.TaskExecutionException;
9   //import net.secodo.jcircuitbreaker.task.Task;
10  //
11  //public abstract class AbstractCustomExceptionsCircuitBreaker<R, E1 extends Exception> 
12  // extends AbstractCircuitBreaker<R>  {
13  //
14  //  public <U> R executeWithExceptions(Task<R> task, BreakStrategy<R> breakStrategy, BreakHandler<R> breakHandler,  
15  //                                 U userData, Class<E1> exceptionClass1) 
16  //      throws TaskExecutionException, BreakHandlerException, CircuitBreakerException, E1 {
17  //
18  //    try {
19  //      return super.execute(task, breakStrategy, breakHandler, userData);
20  //    } catch (TaskExecutionException e) {
21  //      if (exceptionClass1.isInstance(e.getTaskException())) {
22  //        throw (E1) e.getTaskException();
23  //      } else {
24  //        throw e;
25  //      }
26  //    } 
27  //  }
28  //  
29  //}