use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.
the class ExceptionClassifierRetryPolicy method registerThrowable.
/**
* Delegate to the policy currently activated in the context.
*
* @see RetryPolicy#registerThrowable(RetryContext,
* Throwable)
*/
public void registerThrowable(RetryContext context, Throwable throwable) {
RetryPolicy policy = (RetryPolicy) context;
policy.registerThrowable(context, throwable);
((RetryContextSupport) context).registerThrowable(throwable);
}
use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.
the class RetrySynchronizationManagerTests method testStatusRegistration.
@Test
public void testStatusRegistration() throws Exception {
RetryContext status = new RetryContextSupport(null);
RetryContext value = RetrySynchronizationManager.register(status);
assertNull(value);
value = RetrySynchronizationManager.register(status);
assertEquals(status, value);
}
use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.
the class RetrySynchronizationManagerTests method testParent.
@Test
public void testParent() throws Exception {
RetryContext parent = new RetryContextSupport(null);
RetryContext child = new RetryContextSupport(parent);
assertSame(parent, child.getParent());
}
use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.
the class SoftReferenceMapRetryContextCacheTests method testPutOverLimit.
@Test(expected = RetryCacheCapacityExceededException.class)
public void testPutOverLimit() {
RetryContextSupport context = new RetryContextSupport(null);
cache.setCapacity(1);
cache.put("foo", context);
cache.put("foo", context);
}
use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.
the class MapRetryContextCacheTests method testPutOverLimit.
@Test(expected = RetryCacheCapacityExceededException.class)
public void testPutOverLimit() {
RetryContextSupport context = new RetryContextSupport(null);
cache.setCapacity(1);
cache.put("foo", context);
cache.put("foo", context);
}
Aggregations