Examples of canRetry()


Examples of org.springframework.retry.RetryPolicy.canRetry()

   *
   * @see org.springframework.retry.RetryPolicy#canRetry(org.springframework.retry.RetryContext)
   */
  public boolean canRetry(RetryContext context) {
    RetryPolicy policy = (RetryPolicy) context;
    return policy.canRetry(context);
  }

  /**
   * Delegate to the policy currently activated in the context.
   *
 
View Full Code Here

Examples of org.springframework.retry.RetryPolicy.canRetry()

      // expected
    }

    RetryContext context = retryTemplate.open(retryPolicy, state);
    // True after exhausted - the history is reset...
    assertTrue(retryPolicy.canRetry(context));
  }

  @Test
  public void testKeyGeneratorNotConsistentAfterFailure() throws Throwable {
View Full Code Here

Examples of org.springframework.retry.policy.NeverRetryPolicy.canRetry()

    NeverRetryPolicy retryPolicy = new NeverRetryPolicy();
    RetryState state = new DefaultRetryState("foo");
    RetryContext context = retryTemplate.open(retryPolicy, state);
    assertNotNull(context);
    retryTemplate.registerThrowable(retryPolicy, state, context, new Exception());
    assertFalse(retryPolicy.canRetry(context));
  }

  @Test
  public void testClose() throws Exception {
    NeverRetryPolicy retryPolicy = new NeverRetryPolicy();
View Full Code Here

Examples of org.springframework.retry.policy.NeverRetryPolicy.canRetry()

    NeverRetryPolicy retryPolicy = new NeverRetryPolicy();
    RetryState state = new DefaultRetryState("foo");
    RetryContext context = retryTemplate.open(retryPolicy, state);
    assertNotNull(context);
    retryTemplate.registerThrowable(retryPolicy, state, context, new Exception());
    assertFalse(retryPolicy.canRetry(context));
    retryTemplate.close(retryPolicy, context, state, true);
    // still can't retry, even if policy is closed
    // (not that this would happen in practice)...
    assertFalse(retryPolicy.canRetry(context));
  }
View Full Code Here

Examples of org.springframework.retry.policy.NeverRetryPolicy.canRetry()

    retryTemplate.registerThrowable(retryPolicy, state, context, new Exception());
    assertFalse(retryPolicy.canRetry(context));
    retryTemplate.close(retryPolicy, context, state, true);
    // still can't retry, even if policy is closed
    // (not that this would happen in practice)...
    assertFalse(retryPolicy.canRetry(context));
  }

  @Test
  public void testRecover() throws Throwable {
    retryTemplate.setRetryPolicy(new SimpleRetryPolicy(1, Collections
View Full Code Here

Examples of org.springframework.retry.policy.SimpleRetryPolicy.canRetry()

      // expected
    }

    RetryContext context = retryTemplate.open(retryPolicy, state);
    // True after exhausted - the history is reset...
    assertTrue(retryPolicy.canRetry(context));
  }

  @Test
  public void testKeyGeneratorNotConsistentAfterFailure() throws Throwable {
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.