本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}