gpt4 book ai didi

org.springframework.cloud.zookeeper.discovery.ZookeeperDiscoveryProperties.getRoot()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 11:11:31 25 4
gpt4 key购买 nike

本文整理了Java中org.springframework.cloud.zookeeper.discovery.ZookeeperDiscoveryProperties.getRoot()方法的一些代码示例,展示了ZookeeperDiscoveryProperties.getRoot()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperDiscoveryProperties.getRoot()方法的具体详情如下:
包路径:org.springframework.cloud.zookeeper.discovery.ZookeeperDiscoveryProperties
类名称:ZookeeperDiscoveryProperties
方法名:getRoot

ZookeeperDiscoveryProperties.getRoot介绍

暂无

代码示例

代码示例来源:origin: spring-cloud/spring-cloud-zookeeper

private String prepareQueryName(String name) {
  String root = this.zookeeperDiscoveryProperties.getRoot();
  return name.startsWith(root) ? name : root + name;
}

代码示例来源:origin: com.ofg/micro-infra-spring-config

private static String rootWithoutStartingSlash(ZookeeperDiscoveryProperties zookeeperDiscoveryProperties) {
  if (zookeeperDiscoveryProperties.getRoot().startsWith("/")) {
    return zookeeperDiscoveryProperties.getRoot().substring(1);
  }
  return zookeeperDiscoveryProperties.getRoot();
}

代码示例来源:origin: spring-cloud/spring-cloud-zookeeper

private String getPathWithoutRoot(String path) {
  return path.substring(this.zookeeperDiscoveryProperties.getRoot().length());
}

代码示例来源:origin: com.ofg/micro-infra-spring-base

@Bean
@Profile(PRODUCTION)
public MetricsBasePath metricsBasePath(@Value("${metrics.path.root:apps}") String rootName,
                    @Value("${metrics.path.environment:#{systemProperties['APP_ENV'] ?: 'test'}}") String environment,
                    @Value("spring.application.name") String springAppName,
                    @Value("${metrics.path.node:#{T(com.ofg.infrastructure.metrics.config.MetricsConfiguration).resolveLocalHostName()}}") String node) {
  String basePath = zookeeperDiscoveryProperties != null ? zookeeperDiscoveryProperties.getRoot() : serviceConfigurationResolver.getBasePath();
  String applicationName = zookeeperDiscoveryProperties != null ? getLastName(springAppName) : serviceConfigurationResolver.getMicroservicePath().getLastName();
  String country = env.getProperty("metrics.path.country", basePath);
  String appName = env.getProperty("metrics.path.app", applicationName);
  return new EnvironmentAwareMetricsBasePath(rootName, environment, country, appName, node);
}

代码示例来源:origin: spring-cloud/spring-cloud-zookeeper

@Override
  public ServiceDiscovery<ZookeeperInstance> customize(ServiceDiscoveryBuilder<ZookeeperInstance> builder) {
    // @formatter:off
    return builder
        .client(this.curator)
        .basePath(this.properties.getRoot())
        .serializer(this.instanceSerializer)
        .build();
    // @formatter:on
  }
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-contract-stub-runner

protected ServiceDiscovery serviceDiscovery(ServiceInstance serviceInstance) {
  return ServiceDiscoveryBuilder.builder(Void.class)
      .basePath(this.zookeeperDiscoveryProperties.getRoot())
      .client(this.curatorFramework).thisInstance(serviceInstance).build();
}

代码示例来源:origin: spring-cloud/spring-cloud-zookeeper

@Override
public void onApplicationEvent(InstanceRegisteredEvent<?> event) {
  this.cache = TreeCache.newBuilder(this.curator, this.properties.getRoot()).build();
  this.cache.getListenable().addListener(this);
  try {
    this.cache.start();
  }
  catch (Exception e) {
    ReflectionUtils.rethrowRuntimeException(e);
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com