當前位置: 首頁>>代碼示例>>Java>>正文


Java BackOffContext類代碼示例

本文整理匯總了Java中org.springframework.retry.backoff.BackOffContext的典型用法代碼示例。如果您正苦於以下問題:Java BackOffContext類的具體用法?Java BackOffContext怎麽用?Java BackOffContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BackOffContext類屬於org.springframework.retry.backoff包,在下文中一共展示了BackOffContext類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import org.springframework.retry.backoff.BackOffContext; //導入依賴的package包/類
@Override
public BackOffContext start(RetryContext retryContext) {
    return new BackOffContext() {
        @Override
        protected Object clone() throws CloneNotSupportedException {
            return super.clone();
        }
    };
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-commons,代碼行數:10,代碼來源:RetryLoadBalancerInterceptorTest.java

示例2: testBackOffPolicyIsExponential

import org.springframework.retry.backoff.BackOffContext; //導入依賴的package包/類
@Test
public void testBackOffPolicyIsExponential()
{
	List<Long> sleeps = newArrayList();
	ExponentialBackOffPolicy fakeBackOff = this.backOffPolicy.withSleeper(sleeps::add);
	BackOffContext context = fakeBackOff.start(null);
	for (int i = 0; i < 11; i++)
	{
		fakeBackOff.backOff(context);
	}
	assertEquals(sleeps,
			Arrays.asList(1000L, 2000L, 4000L, 8000L, 16000L, 32000L, 64000L, 128000L, 256000L, 300000L, 300000L));
}
 
開發者ID:molgenis,項目名稱:molgenis,代碼行數:14,代碼來源:ConnectionRetryConfigTest.java

示例3: backOff

import org.springframework.retry.backoff.BackOffContext; //導入依賴的package包/類
@Override
public void backOff(BackOffContext backOffContext) throws BackOffInterruptedException {
    backoffAttempts++;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-commons,代碼行數:5,代碼來源:RetryLoadBalancerInterceptorTest.java

示例4: start

import org.springframework.retry.backoff.BackOffContext; //導入依賴的package包/類
@Override
public BackOffContext start(RetryContext retryContext) {
	return null;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-netflix,代碼行數:5,代碼來源:RibbonLoadBalancingHttpClientTests.java

示例5: backOff

import org.springframework.retry.backoff.BackOffContext; //導入依賴的package包/類
@Override
public void backOff(BackOffContext backOffContext) throws BackOffInterruptedException {
	count++;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-netflix,代碼行數:5,代碼來源:RibbonLoadBalancingHttpClientTests.java


注:本文中的org.springframework.retry.backoff.BackOffContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。