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


Java IClientConfig.getClientName方法代码示例

本文整理汇总了Java中com.netflix.client.config.IClientConfig.getClientName方法的典型用法代码示例。如果您正苦于以下问题:Java IClientConfig.getClientName方法的具体用法?Java IClientConfig.getClientName怎么用?Java IClientConfig.getClientName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.netflix.client.config.IClientConfig的用法示例。


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

示例1: testServiceCombServerList

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
@Test
public void testServiceCombServerList(@Injectable IClientConfig iClientConfig,
    @Mocked RegistryUtils registryUtils,
    @Mocked DiscoveryTree discoveryTree,
    @Injectable DiscoveryTreeNode versionedCache) {
  Map<String, MicroserviceInstance> servers = new HashMap<>();
  List<String> endpoints = new ArrayList<>();
  endpoints.add("rest://localhost:3333");
  endpoints.add("rest://localhost:4444");
  MicroserviceInstance instance1 = new MicroserviceInstance();
  instance1.setServiceId("service1");
  instance1.setInstanceId("service1-instance1");
  instance1.setEndpoints(endpoints);
  servers.put("service1-instance1", instance1);

  new Expectations() {
    {
      iClientConfig.getClientName();
      result = "serviceId1";

      RegistryUtils.getAppId();
      result = "app";
      discoveryTree.discovery((DiscoveryContext) any, anyString, anyString, anyString);
      result = versionedCache;
      versionedCache.data();
      result = servers;
    }
  };

  ServiceCombServerList list = new ServiceCombServerList();
  list.initWithNiwsConfig(iClientConfig);
  List<Server> serverList = list.getInitialListOfServers();
  Assert.assertEquals(2, serverList.size());
  Assert.assertEquals(4444, serverList.get(1).getPort());
  Assert.assertEquals(serverList.size(), list.getUpdatedListOfServers().size());
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:37,代码来源:TestServiceCombServerList.java

示例2: initWithNiwsConfig

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
@Override
public void initWithNiwsConfig(IClientConfig iClientConfig) {
  this.serviceId = iClientConfig.getClientName();
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:5,代码来源:ServiceCombServerList.java

示例3: ribbonServerList

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
@Bean
@ConditionalOnMissingBean
public ServerList<?> ribbonServerList(IClientConfig config, Client etcdClient, EtcdDiscoveryProperties properties) {
  return new EtcdServerList(etcdClient, properties, config.getClientName());
}
 
开发者ID:ScienJus,项目名称:spring-cloud-etcd,代码行数:6,代码来源:EtcdRibbonClientConfiguration.java

示例4: initWithNiwsConfig

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
public void initWithNiwsConfig(IClientConfig clientConfig) {
    this.serviceId = clientConfig.getClientName();
    this.namespace = clientConfig.getPropertyAsString(KubernetesConfigKey.Namespace, client.getNamespace());
    this.portName = clientConfig.getPropertyAsString(KubernetesConfigKey.PortName, null);
}
 
开发者ID:fabric8io,项目名称:spring-cloud-kubernetes,代码行数:6,代码来源:KubernetesServerList.java

示例5: initWithNiwsConfig

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
@Override
public void initWithNiwsConfig(IClientConfig config) {
    this.appName = config.getClientName();
    this.isSecure = config.get(IClientConfigKey.Keys.IsSecure, false);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:6,代码来源:TopologyServerList.java

示例6: initWithNiwsConfig

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
public void initWithNiwsConfig(IClientConfig config) {
  this.serviceId = config.getClientName();
  this.client = new ConsulServerListBuilder();

}
 
开发者ID:januslabs,项目名称:consul-ribbon-starter,代码行数:6,代码来源:ConsulServerList.java

示例7: initWithNiwsConfig

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
@Override
public void initWithNiwsConfig(IClientConfig clientConfig) {
	this.serviceId = clientConfig.getClientName();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-lattice,代码行数:5,代码来源:LatticeServerList.java

示例8: getServiceIdFromDepsOrClientName

import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
private String getServiceIdFromDepsOrClientName(IClientConfig clientConfig, ZookeeperDependencies zookeeperDependencies) {
	String serviceIdFromDeps = zookeeperDependencies.getPathForAlias(clientConfig.getClientName());
	return StringUtils.hasText(serviceIdFromDeps) ? serviceIdFromDeps : clientConfig.getClientName();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-zookeeper,代码行数:5,代码来源:ZookeeperServerList.java


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