本文整理汇总了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());
}
示例2: initWithNiwsConfig
import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
@Override
public void initWithNiwsConfig(IClientConfig iClientConfig) {
this.serviceId = iClientConfig.getClientName();
}
示例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());
}
示例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);
}
示例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);
}
示例6: initWithNiwsConfig
import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
public void initWithNiwsConfig(IClientConfig config) {
this.serviceId = config.getClientName();
this.client = new ConsulServerListBuilder();
}
示例7: initWithNiwsConfig
import com.netflix.client.config.IClientConfig; //导入方法依赖的package包/类
@Override
public void initWithNiwsConfig(IClientConfig clientConfig) {
this.serviceId = clientConfig.getClientName();
}
示例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();
}