• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ClientHttpEngine类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.resteasy.client.jaxrs.ClientHttpEngine的典型用法代码示例。如果您正苦于以下问题:Java ClientHttpEngine类的具体用法?Java ClientHttpEngine怎么用?Java ClientHttpEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClientHttpEngine类属于org.jboss.resteasy.client.jaxrs包,在下文中一共展示了ClientHttpEngine类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: create

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
@Override
public Client create(final RestClientConfiguration configuration) {
  checkNotNull(configuration);

  try (TcclBlock tccl = TcclBlock.begin(ResteasyClientBuilder.class)) {
    HttpContext httpContext = new BasicHttpContext();
    if (configuration.getUseTrustStore()) {
        httpContext.setAttribute(SSLContextSelector.USE_TRUST_STORE, true);
    }
    HttpClient client;
    if (configuration.getHttpClient() != null) {
      client = checkNotNull(configuration.getHttpClient().get());
    }
    else {
      client = httpClient.get();
    }
    ClientHttpEngine httpEngine = new ApacheHttpClient4Engine(client, httpContext);

    ResteasyClientBuilder builder = new ResteasyClientBuilder().httpEngine(httpEngine);

    if (configuration.getCustomizer() != null) {
      configuration.getCustomizer().apply(builder);
    }

    return builder.build();
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:28,代码来源:RestClientFactoryImpl.java


示例2: SchedulerRestClient

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
public SchedulerRestClient(String restEndpointURL, ClientHttpEngine httpEngine) {
    this.restEndpointURL = restEndpointURL;
    this.httpEngine = httpEngine;

    providerFactory = ResteasyProviderFactory.getInstance();
    if (!providerFactory.isRegistered(JacksonContextResolver.class)) {
        providerFactory.registerProvider(JacksonContextResolver.class);
    }

    scheduler = createRestProxy(providerFactory, restEndpointURL, httpEngine);
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:12,代码来源:SchedulerRestClient.java


示例3: createRestProxy

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
private static SchedulerRestInterface createRestProxy(ResteasyProviderFactory provider, String restEndpointURL,
        ClientHttpEngine httpEngine) {
    ResteasyClient client = new ResteasyClientBuilder().providerFactory(provider).httpEngine(httpEngine).build();
    ResteasyWebTarget target = client.target(restEndpointURL);
    SchedulerRestInterface schedulerRestClient = target.proxy(SchedulerRestInterface.class);
    return createExceptionProxy(schedulerRestClient);
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:8,代码来源:SchedulerRestClient.java


示例4: build

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
@Override
public ResteasyClient build()
{
    ClientConfiguration config = new ClientConfiguration(getProviderFactory());
    for (Map.Entry<String, Object> entry : properties.entrySet()) {
        config.property(entry.getKey(), entry.getValue());
    }

    ExecutorService executor = asyncExecutor;

    boolean cleanupExecutor = false;
    if (executor == null) {
        cleanupExecutor = true;
        executor = Executors.newFixedThreadPool(10);
    }

    ClientHttpEngine engine = httpEngine;
    if (engine == null) {
        engine = initDefaultEngine();
    }

    try {
        Constructor<ResteasyClient> constructor = ResteasyClient.class.getDeclaredConstructor(
            ClientHttpEngine.class, ExecutorService.class,
            boolean.class, ClientConfiguration.class);
        constructor.setAccessible(true);
        return constructor.newInstance(engine, executor, cleanupExecutor, config);
    } catch (NoSuchMethodException | InstantiationException |
             IllegalAccessException | InvocationTargetException ex) {
        throw new ClcClientException(ex);
    }

}
 
开发者ID:CenturyLinkCloud,项目名称:clc-java-sdk,代码行数:34,代码来源:SdkClientBuilder.java


示例5: initDefaultEngine

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected ClientHttpEngine initDefaultEngine() {
    ApacheHttpClient4Engine httpEngine = (ApacheHttpClient4Engine) super.initDefaultEngine();
    if (proxyCredentials != null) {
        ((DefaultHttpClient) httpEngine.getHttpClient()).setCredentialsProvider(proxyCredentials);
    }
    return httpEngine;
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:10,代码来源:ResteasyGitLabClientBuilder.java


示例6: Gw2Client

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
private Gw2Client() {
    config = AppConfig.getInstance();
    final ClientHttpEngine engine = HttpEngine.getHttpEngine();
    client = new ResteasyClientBuilder()
            .httpEngine(engine)
            .disableTrustManager()
            .build();
    final WebTarget target = client.target(config.getString("endpoints.gw2rest"));
    gw2resource = ProxyBuilder.builder(Gw2RestInterface.class, target).build();
    LOG.debug("Gw2Client initialized");
}
 
开发者ID:zyclonite,项目名称:gw2live,代码行数:12,代码来源:Gw2Client.java


示例7: DataSpaceClient

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
public DataSpaceClient(String restServerUrl, ClientHttpEngine httpEngine) {
    this.httpEngine = httpEngine;
    this.restDataspaceUrl = restDataspaceUrl(restServerUrl);
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:5,代码来源:DataSpaceClient.java


示例8: setHttpEngine

import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; //导入依赖的package包/类
/**
 * Set the backing {@link ClientHttpEngine} to be used for all http calls.
 *
 * @return this builder
 */
public BeadledomResteasyClientBuilder setHttpEngine(ClientHttpEngine httpEngine) {
  this.httpEngine = httpEngine;
  return this;
}
 
开发者ID:cerner,项目名称:beadledom,代码行数:10,代码来源:BeadledomResteasyClientBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XML11NSDocumentScannerImpl类代码示例发布时间:2022-05-23
下一篇:
Java ActionBarAssert类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap