com.alibaba.dubbo.registry.support
Class AbstractRegistryFactory

java.lang.Object
  extended by com.alibaba.dubbo.registry.support.AbstractRegistryFactory
All Implemented Interfaces:
RegistryFactory
Direct Known Subclasses:
DubboRegistryFactory, MulticastRegistryFactory, ZookeeperRegistryFactory

public abstract class AbstractRegistryFactory
extends Object
implements RegistryFactory

AbstractRegistryFactory. (SPI, Singleton, ThreadSafe)

Author:
william.liangf
See Also:
RegistryFactory

Constructor Summary
AbstractRegistryFactory()
           
 
Method Summary
static void destroyAll()
          关闭所有已创建注册中心
static Collection<Registry> getRegistries()
          获取所有注册中心
 Registry getRegistry(URL url)
          连接注册中心.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRegistryFactory

public AbstractRegistryFactory()
Method Detail

getRegistries

public static Collection<Registry> getRegistries()
获取所有注册中心

Returns:
所有注册中心

destroyAll

public static void destroyAll()
关闭所有已创建注册中心


getRegistry

public Registry getRegistry(URL url)
Description copied from interface: RegistryFactory
连接注册中心.

连接注册中心需处理契约:
1. 当设置check=false时表示不检查连接,否则在连接不上时抛出异常。
2. 支持URL上的username:password权限认证。
3. 支持backup=10.20.153.10备选注册中心集群地址。
4. 支持file=registry.cache本地磁盘文件缓存。
5. 支持timeout=1000请求超时设置。
6. 支持session=60000会话超时或过期设置。

Specified by:
getRegistry in interface RegistryFactory
Parameters:
url - 注册中心地址,不允许为空
Returns:
注册中心引用,总不返回空


Copyright © 2012–2017 Alibaba. All rights reserved.