Examples of RetryInterceptor


Examples of com.amazonaws.services.simpleworkflow.flow.interceptors.RetryInterceptor

        if (signature instanceof MethodSignature) {
            final MethodSignature methodSignature = (MethodSignature) signature;
            isVoidReturnType = (methodSignature != null) ? Void.TYPE.equals(methodSignature.getReturnType()) : false;
        }
       
        RetryInterceptor interceptor = null;
        if (isVoidReturnType) {
            interceptor = new RetryInterceptorVoid(retryCallable, retryPolicy);
        } else {
            interceptor = new RetryInterceptorWithResult(retryCallable, retryPolicy);
        }
       
        return interceptor.execute();
    }
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.RetryInterceptor

  @Deployment(resources={"org/activiti/engine/test/concurrency/CompetingSignalsTest.testCompetingSignals.bpmn20.xml"})
  public void testCompetingSignalsWithRetry() throws Exception {
    RuntimeServiceImpl runtimeServiceImpl = (RuntimeServiceImpl)runtimeService;       
    CommandExecutorImpl before = (CommandExecutorImpl) runtimeServiceImpl.getCommandExecutor();
    try {
      CommandInterceptor retryInterceptor = new RetryInterceptor();
      retryInterceptor.setNext(before.getFirst());

      runtimeServiceImpl.setCommandExecutor(new CommandExecutorImpl(before.getDefaultConfig(), retryInterceptor));
     
      ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("CompetingSignalsProcess");
      String processInstanceId = processInstance.getId();
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.RetryInterceptor

      throw new ActivitiOptimisticLockingException("");
    }
  }

  public void testRetryInterceptor() {
    RetryInterceptor retryInterceptor = new RetryInterceptor();
    retryInterceptor.setNext(new CommandInvoker());
    try {
      retryInterceptor.execute(new CommandConfig(), new CommandThrowingOptimisticLockingException());
      fail("ActivitiException expected.");
    } catch (ActivitiException e) {
      assertTrue(e.getMessage().contains(retryInterceptor.getNumOfRetries()+" retries failed"));
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.RetryInterceptor

      throw new ActivitiOptimisticLockingException("");
    }
  }

  public void testRetryInterceptor() {
    RetryInterceptor retryInterceptor = new RetryInterceptor();
    retryInterceptor.setNext(new CommandExecutorImpl());
    try {
      retryInterceptor.execute(new CommandThrowingOptimisticLockingException());
      fail("ActivitiException expected.");
    }catch (ActivitiException e) {
      assertTrue(e.getMessage().contains(retryInterceptor.getNumOfRetries()+" retries failed"));
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.RetryInterceptor

  @Deployment(resources={"org/activiti/engine/test/concurrency/CompetingSignalsTest.testCompetingSignals.bpmn20.xml"})
  public void testCompetingSignalsWithRetry() throws Exception {
    RuntimeServiceImpl runtimeServiceImpl = (RuntimeServiceImpl)runtimeService;       
    CommandExecutor before = runtimeServiceImpl.getCommandExecutor();
    try {
      CommandInterceptor retryInterceptor = new RetryInterceptor();
      retryInterceptor.setNext(before);
      runtimeServiceImpl.setCommandExecutor(retryInterceptor);
     
      ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("CompetingSignalsProcess");
      String processInstanceId = processInstance.getId();
 
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.RetryInterceptor

  @Deployment(resources={"org/camunda/bpm/engine/test/concurrency/CompetingSignalsTest.testCompetingSignals.bpmn20.xml"})
  public void testCompetingSignalsWithRetry() throws Exception {
    RuntimeServiceImpl runtimeServiceImpl = (RuntimeServiceImpl)runtimeService;       
    CommandExecutor before = runtimeServiceImpl.getCommandExecutor();
    try {
      CommandInterceptor retryInterceptor = new RetryInterceptor();
      retryInterceptor.setNext(before);
      runtimeServiceImpl.setCommandExecutor(retryInterceptor);
     
      ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("CompetingSignalsProcess");
      String processInstanceId = processInstance.getId();
 
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.RetryInterceptor

      throw new OptimisticLockingException("");
    }
  }

  public void testRetryInterceptor() {
    RetryInterceptor retryInterceptor = new RetryInterceptor();
    retryInterceptor.setNext(new CommandExecutorImpl());
    try {
      retryInterceptor.execute(new CommandThrowingOptimisticLockingException());
      fail("ProcessEngineException expected.");
    }catch (ProcessEngineException e) {
      assertTrue(e.getMessage().contains(retryInterceptor.getNumOfRetries()+" retries failed"));
    }
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.svc.RetryInterceptor

  public RetryInterceptorBinding() {
    super("retry-interceptor");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    RetryInterceptor retryInterceptor = null;
   
    String type = XmlUtil.attribute(element, "type");
    if ("jta".equals(type)) {
      retryInterceptor = new JtaRetryInterceptor();
    } else {
      retryInterceptor = new RetryInterceptor();
    }
   
   
    if (element.hasAttribute("retries")) {
      String retriesText = element.getAttribute("retries");
      try {
        int retries = Integer.parseInt(retriesText);
        retryInterceptor.setRetries(retries);
      } catch (NumberFormatException e) {
        parse.addProblem("couldn't parse retries "+retriesText, element);
      }
    }

    if (element.hasAttribute("delay")) {
      String delayText = element.getAttribute("delay");
      try {
        long delay = Long.parseLong(delayText);
        retryInterceptor.setDelay(delay);
      } catch (NumberFormatException e) {
        parse.addProblem("couldn't parse delay "+delayText, element);
      }
    }

    if (element.hasAttribute("delay-factor")) {
      String delayFactorText = element.getAttribute("delay-factor");
      try {
        long delayFactor = Long.parseLong(delayFactorText);
        retryInterceptor.setDelayFactor(delayFactor);
      } catch (NumberFormatException e) {
        parse.addProblem("couldn't parse delay-factor "+delayFactorText, element);
      }
    }
View Full Code Here

Examples of org.jbpm.pvm.internal.svc.RetryInterceptor

  public RetryInterceptorBinding() {
    super("retry-interceptor");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    RetryInterceptor retryInterceptor = null;
   
    String type = XmlUtil.attribute(element, "type");
    if ("jta".equals(type)) {
      retryInterceptor = new JtaRetryInterceptor();
    } else {
      retryInterceptor = new RetryInterceptor();
    }
   
   
    if (element.hasAttribute("retries")) {
      String retriesText = element.getAttribute("retries");
      try {
        int retries = Integer.parseInt(retriesText);
        retryInterceptor.setRetries(retries);
      } catch (NumberFormatException e) {
        parse.addProblem("couldn't parse retries "+retriesText, element);
      }
    }

    if (element.hasAttribute("delay")) {
      String delayText = element.getAttribute("delay");
      try {
        long delay = Long.parseLong(delayText);
        retryInterceptor.setDelay(delay);
      } catch (NumberFormatException e) {
        parse.addProblem("couldn't parse delay "+delayText, element);
      }
    }

    if (element.hasAttribute("delay-factor")) {
      String delayFactorText = element.getAttribute("delay-factor");
      try {
        long delayFactor = Long.parseLong(delayFactorText);
        retryInterceptor.setDelayFactor(delayFactor);
      } catch (NumberFormatException e) {
        parse.addProblem("couldn't parse delay-factor "+delayFactorText, element);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.