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


Java SimpleClientHttpRequestFactory.setTaskExecutor方法代碼示例

本文整理匯總了Java中org.springframework.http.client.SimpleClientHttpRequestFactory.setTaskExecutor方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleClientHttpRequestFactory.setTaskExecutor方法的具體用法?Java SimpleClientHttpRequestFactory.setTaskExecutor怎麽用?Java SimpleClientHttpRequestFactory.setTaskExecutor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.http.client.SimpleClientHttpRequestFactory的用法示例。


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

示例1: AsyncRestTemplate

import org.springframework.http.client.SimpleClientHttpRequestFactory; //導入方法依賴的package包/類
/**
 * Create a new instance of the {@code AsyncRestTemplate} using the given
 * {@link AsyncTaskExecutor}.
 * <p>This constructor uses a {@link SimpleClientHttpRequestFactory} in combination
 * with the given {@code AsyncTaskExecutor} for asynchronous execution.
 */
public AsyncRestTemplate(AsyncListenableTaskExecutor taskExecutor) {
	Assert.notNull(taskExecutor, "AsyncTaskExecutor must not be null");
	SimpleClientHttpRequestFactory requestFactory =
			new SimpleClientHttpRequestFactory();
	requestFactory.setTaskExecutor(taskExecutor);
	this.syncTemplate = new RestTemplate(requestFactory);
	setAsyncRequestFactory(requestFactory);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:15,代碼來源:AsyncRestTemplate.java

示例2: AsyncRestTemplate

import org.springframework.http.client.SimpleClientHttpRequestFactory; //導入方法依賴的package包/類
/**
 * Create a new instance of the {@code AsyncRestTemplate} using the given
 * {@link AsyncTaskExecutor}.
 * <p>This constructor uses a {@link SimpleClientHttpRequestFactory} in combination
 * with the given {@code AsyncTaskExecutor} for asynchronous execution.
 */
public AsyncRestTemplate(AsyncListenableTaskExecutor taskExecutor) {
	Assert.notNull(taskExecutor, "AsyncTaskExecutor must not be null");
	SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
	requestFactory.setTaskExecutor(taskExecutor);
	this.syncTemplate = new RestTemplate(requestFactory);
	setAsyncRequestFactory(requestFactory);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:14,代碼來源:AsyncRestTemplate.java

示例3: simpleRequestFactory

import org.springframework.http.client.SimpleClientHttpRequestFactory; //導入方法依賴的package包/類
static HttpConfigurer simpleRequestFactory(final ExecutorService executor) {
    return builder -> {
        final SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
        factory.setTaskExecutor(new ConcurrentTaskExecutor(executor));
        builder.requestFactory(factory);
    };
}
 
開發者ID:zalando,項目名稱:riptide,代碼行數:8,代碼來源:HttpBuilder.java

示例4: getAsyncRestTemplate

import org.springframework.http.client.SimpleClientHttpRequestFactory; //導入方法依賴的package包/類
private AsyncRestTemplate getAsyncRestTemplate() {
    SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
    factory.setTaskExecutor(new SimpleAsyncTaskExecutor());
    factory.setConnectTimeout(gorouterProperties.getConnectTimeout());
    factory.setReadTimeout(gorouterProperties.getReadTimeout());

    return new AsyncRestTemplate(factory);
}
 
開發者ID:trustedanalytics,項目名稱:router-metrics-provider,代碼行數:9,代碼來源:GatheringConfig.java

示例5: defaultClientHttpRequestFactory

import org.springframework.http.client.SimpleClientHttpRequestFactory; //導入方法依賴的package包/類
private SimpleClientHttpRequestFactory defaultClientHttpRequestFactory(Tracer tracer) {
	SimpleClientHttpRequestFactory simpleClientHttpRequestFactory = new SimpleClientHttpRequestFactory();
	simpleClientHttpRequestFactory.setTaskExecutor(asyncListenableTaskExecutor(tracer));
	return simpleClientHttpRequestFactory;
}
 
開發者ID:reshmik,項目名稱:Zipkin,代碼行數:6,代碼來源:TraceWebAsyncClientAutoConfiguration.java

示例6: defaultClientHttpRequestFactory

import org.springframework.http.client.SimpleClientHttpRequestFactory; //導入方法依賴的package包/類
private SimpleClientHttpRequestFactory defaultClientHttpRequestFactory() {
	SimpleClientHttpRequestFactory simpleClientHttpRequestFactory = new SimpleClientHttpRequestFactory();
	simpleClientHttpRequestFactory.setTaskExecutor(asyncListenableTaskExecutor(this.tracer));
	return simpleClientHttpRequestFactory;
}
 
開發者ID:reshmik,項目名稱:Zipkin,代碼行數:6,代碼來源:TraceAsyncClientHttpRequestFactoryWrapper.java

示例7: asyncRestTemplate

import org.springframework.http.client.SimpleClientHttpRequestFactory; //導入方法依賴的package包/類
@Bean
AsyncRestTemplate asyncRestTemplate(@LoadBalanced RestTemplate restTemplate) {
    SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
    requestFactory.setTaskExecutor(threadPoolTaskScheduler());
    return new AsyncRestTemplate(requestFactory, restTemplate);
}
 
開發者ID:spring-cloud-samples,項目名稱:brewery,代碼行數:7,代碼來源:BottlingConfiguration.java


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