作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.yammer.breakerbox.turbine.YamlInstanceDiscovery
类的一些代码示例,展示了YamlInstanceDiscovery
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlInstanceDiscovery
类的具体详情如下:
包路径:com.yammer.breakerbox.turbine.YamlInstanceDiscovery
类名称:YamlInstanceDiscovery
暂无
代码示例来源:origin: yammer/breakerbox
public YamlInstanceDiscovery(Path path,
Validator validator,
ObjectMapper objectMapper) {
this.path = path;
this.configurationFactory = new YamlConfigurationFactory<>(
YamlInstanceConfiguration.class,
validator,
objectMapper,
"dw");
parseYamlInstanceConfiguration();
}
代码示例来源:origin: yammer/breakerbox
private static InstanceDiscovery createClassInstance(Class<InstanceDiscovery> instanceDiscoveryClass,
BreakerboxServiceConfiguration configuration,
Environment environment) throws Exception {
if(instanceDiscoveryClass.equals(RancherInstanceDiscovery.class)
&& configuration.getRancherInstanceConfiguration().isPresent()) {
return new RancherInstanceDiscovery(configuration.getRancherInstanceConfiguration().get(), environment.getObjectMapper());
} else if (instanceDiscoveryClass.equals(YamlInstanceDiscovery.class)) {
return new YamlInstanceDiscovery(configuration.getTurbine(), environment.getValidator(), environment.getObjectMapper());
}
else if (instanceDiscoveryClass.equals(MarathonInstanceDiscovery.class) && configuration.getMarathonClientConfiguration().isPresent()){
return new MarathonInstanceDiscovery(environment.getObjectMapper(),configuration.getMarathonClientConfiguration().get());
}
return instanceDiscoveryClass.getConstructor().newInstance();
}
}
代码示例来源:origin: yammer/breakerbox
private static void setupInstanceDiscovery(BreakerboxServiceConfiguration configuration,
Environment environment) {
final Optional<InstanceDiscovery> customInstanceDiscovery = createInstanceDiscovery(configuration, environment);
if (customInstanceDiscovery.isPresent()) {
if(configuration.getHystrixStreamSuffix().isPresent()){
PluginsFactory.setInstanceDiscovery(RegisterClustersInstanceDiscoveryWrapper.wrap(
customInstanceDiscovery.get(),configuration.getHystrixStreamSuffix().get()));
} else {
PluginsFactory.setInstanceDiscovery(RegisterClustersInstanceDiscoveryWrapper.wrap(
customInstanceDiscovery.get()));
}
} else {
final YamlInstanceDiscovery yamlInstanceDiscovery = new YamlInstanceDiscovery(
configuration.getTurbine(), environment.getValidator(), environment.getObjectMapper());
PluginsFactory.setInstanceDiscovery(RegisterClustersInstanceDiscoveryWrapper.wrap(yamlInstanceDiscovery));
}
}
代码示例来源:origin: yammer/breakerbox
@Override
public Collection<Instance> getInstanceList() throws Exception {
return parseYamlInstanceConfiguration()
.orElse(new YamlInstanceConfiguration())
.getAllInstances();
}
我是一名优秀的程序员,十分优秀!