use of cn.taketoday.retry.context.RetryContextSupport in project today-infrastructure by TAKETODAY.
the class BinaryExceptionClassifierRetryPolicy method registerThrowable.
@Override
public void registerThrowable(RetryContext context, Throwable throwable) {
RetryContextSupport simpleContext = ((RetryContextSupport) context);
simpleContext.registerThrowable(throwable);
}
use of cn.taketoday.retry.context.RetryContextSupport in project today-infrastructure 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-infrastructure by TAKETODAY.
the class SoftReferenceMapRetryContextCacheTests method testPut.
@Test
public void testPut() {
RetryContextSupport context = new RetryContextSupport(null);
cache.put("foo", context);
assertEquals(context, cache.get("foo"));
}
use of cn.taketoday.retry.context.RetryContextSupport in project today-infrastructure 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);
}
use of cn.taketoday.retry.context.RetryContextSupport in project today-framework by TAKETODAY.
the class RetrySynchronizationManagerTests method testClear.
@Test
public void testClear() throws Exception {
RetryContext status = new RetryContextSupport(null);
RetryContext value = RetrySynchronizationManager.register(status);
assertNull(value);
RetrySynchronizationManager.clear();
value = RetrySynchronizationManager.register(status);
assertNull(value);
}
Aggregations