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


Java NingHttpClient类代码示例

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


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

示例1: configure

import com.hubspot.horizon.ning.NingHttpClient; //导入依赖的package包/类
@Override
protected void configure() {
  ObjectMapper objectMapper = JavaUtils.newObjectMapper();

  HttpClient httpClient = new NingHttpClient(HttpConfig.newBuilder().setObjectMapper(objectMapper).build());
  bind(HttpClient.class).annotatedWith(Names.named(HTTP_CLIENT_NAME)).toInstance(httpClient);

  bind(SingularityClient.class).toProvider(SingularityClientProvider.class).in(Scopes.SINGLETON);

  if (hosts != null) {
    bindHosts(binder()).toInstance(hosts);
  }
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:14,代码来源:SingularityClientModule.java

示例2: configure

import com.hubspot.horizon.ning.NingHttpClient; //导入依赖的package包/类
@Override
protected void configure() {
  ObjectMapper objectMapper = JavaUtils.newObjectMapper();
  HttpConfig httpConfig = HttpConfig.newBuilder().setObjectMapper(objectMapper).build();
  HttpClient httpClient = new NingHttpClient(httpConfig);

  bind(ObjectMapper.class).annotatedWith(Names.named(MESOS_CLIENT_OBJECT_MAPPER)).toInstance(objectMapper);
  bind(HttpClient.class).annotatedWith(Names.named(MesosClient.HTTP_CLIENT_NAME)).toInstance(httpClient);
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:10,代码来源:SingularityMesosClientModule.java

示例3: configure

import com.hubspot.horizon.ning.NingHttpClient; //导入依赖的package包/类
@Override
protected void configure() {
  ObjectMapper objectMapper = JavaUtils.newObjectMapper();

  HttpClient httpClient = new NingHttpClient(httpConfig.or(HttpConfig.newBuilder().setObjectMapper(objectMapper).build()));
  bind(HttpClient.class).annotatedWith(Names.named(HTTP_CLIENT_NAME)).toInstance(httpClient);

  bind(SingularityClient.class).toProvider(SingularityClientProvider.class).in(Scopes.SINGLETON);

  if (hosts != null) {
    bindHosts(binder()).toInstance(hosts);
  }
}
 
开发者ID:HubSpot,项目名称:Singularity,代码行数:14,代码来源:SingularityClientModule.java

示例4: configure

import com.hubspot.horizon.ning.NingHttpClient; //导入依赖的package包/类
@Override
protected void configure() {
  ObjectMapper objectMapper = JavaUtils.newObjectMapper();
  HttpConfig httpConfig = HttpConfig.newBuilder().setObjectMapper(objectMapper).build();
  HttpClient httpClient = new NingHttpClient(httpConfig);

  bind(ObjectMapper.class).annotatedWith(Names.named(MESOS_CLIENT_OBJECT_MAPPER)).toInstance(objectMapper);
  bind(HttpClient.class).annotatedWith(Names.named(SingularityMesosClient.HTTP_CLIENT_NAME)).toInstance(httpClient);

  bind(MesosClient.class).to(SingularityMesosClient.class).in(Scopes.SINGLETON);
}
 
开发者ID:HubSpot,项目名称:Singularity,代码行数:12,代码来源:SingularityMesosClientModule.java

示例5: configure

import com.hubspot.horizon.ning.NingHttpClient; //导入依赖的package包/类
@Override
protected void configure() {
  HttpClient httpClient = new NingHttpClient(HttpConfig.newBuilder()
          .setObjectMapper(buildObjectMapper())
          .build());

  bind(HttpClient.class).annotatedWith(Names.named(HTTP_CLIENT_NAME)).toInstance(httpClient);

  bind(BaragonServiceClient.class).toProvider(BaragonClientProvider.class).in(Scopes.SINGLETON);

  if (hosts != null) {
    bindHosts(binder()).toInstance(hosts);
  }
}
 
开发者ID:HubSpot,项目名称:Baragon,代码行数:15,代码来源:BaragonClientModule.java


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