提交 53741850 编写于 作者: A Allen Wang

Merge branch 'master' of https://github.com/Netflix/ribbon into 1.x

......@@ -92,14 +92,22 @@ public class ClientFactory {
* @throws RuntimeException if an error occurs in creating the client.
*/
public static synchronized IClient getNamedClient(String name) {
return getNamedClient(name, DefaultClientConfigImpl.class);
}
/**
* Return the named client from map if already created. Otherwise creates the client using the configuration returned by {@link #createNamedClient(String, Class)}.
*
* @throws RuntimeException if an error occurs in creating the client.
*/
public static synchronized IClient getNamedClient(String name, Class<? extends IClientConfig> configClass) {
if (simpleClientMap.get(name) != null) {
return simpleClientMap.get(name);
return simpleClientMap.get(name);
}
IClientConfig niwsClientConfig = getNamedConfig(name);
try {
return registerClientFromProperties(name, niwsClientConfig);
return createNamedClient(name, configClass);
} catch (ClientException e) {
throw new RuntimeException("Unable to create client", e);
throw new RuntimeException("Unable to create client", e);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册