当前位置: 首页>>代码示例>>Java>>正文


Java ResteasyClientBuilder.connectionPoolSize方法代码示例

本文整理汇总了Java中org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.connectionPoolSize方法的典型用法代码示例。如果您正苦于以下问题:Java ResteasyClientBuilder.connectionPoolSize方法的具体用法?Java ResteasyClientBuilder.connectionPoolSize怎么用?Java ResteasyClientBuilder.connectionPoolSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder的用法示例。


在下文中一共展示了ResteasyClientBuilder.connectionPoolSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; //导入方法依赖的package包/类
@Override
public void start(StartContext startContext) throws StartException {

    Consul.Builder builder = Consul.builder();


    // pool because of multiple threads.
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();
    clientBuilder = clientBuilder.connectionPoolSize(20);

    builder.withClientBuilder(clientBuilder);
    builder.withUrl(this.url);

    try {
        this.consul = builder.build();
    } catch (Exception e) {
        throw new StartException("Failed to connect consul at " + url, e);
    }
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology-consul,代码行数:20,代码来源:ConsulService.java

示例2: DawPurchasesClient

import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; //导入方法依赖的package包/类
public DawPurchasesClient(boolean useHttps, String hostname, int port) {
    checkNotNull(hostname, "hostname");
    checkArgument(port > 0, "Invalid port %s", port);
    String apiHostUrl = String.format("%s://%s:%d", useHttps ? "https" : "http", hostname, port);

    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();
    clientBuilder.establishConnectionTimeout(GLOBAL_TIMEOUT, TimeUnit.MILLISECONDS);
    clientBuilder.socketTimeout(GLOBAL_TIMEOUT, TimeUnit.MILLISECONDS);
    clientBuilder.maxPooledPerRoute(GLOBAL_MAX_CONNS);
    clientBuilder.connectionPoolSize(GLOBAL_MAX_CONNS);
    clientBuilder.connectionTTL(CONNECTION_TTL, TimeUnit.MILLISECONDS);
    clientBuilder.connectionCheckoutTimeout(GET_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS);

    jaxRsClient = clientBuilder.build();
    ResteasyWebTarget target = jaxRsClient.target(apiHostUrl);

    // TODO: potential improvements here:
    //   - Avoid "useHttps" boolean parameter - enum instead

    apiClientProxy = target.proxy(ApiSpec.class);
}
 
开发者ID:MiguelGL,项目名称:popular-purchases-demo,代码行数:22,代码来源:DawPurchasesClient.java


注:本文中的org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.connectionPoolSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。