类 RegistryDirectory<T>
- java.lang.Object
-
- com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory<T>
-
- com.alibaba.dubbo.registry.integration.RegistryDirectory<T>
-
- 所有已实现的接口:
Node
,NotifyListener
,Directory<T>
public class RegistryDirectory<T> extends AbstractDirectory<T> implements NotifyListener
RegistryDirectory
-
-
构造器概要
构造器 构造器 说明 RegistryDirectory(Class<T> serviceType, URL url)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 void
destroy()
destroy.List<Invoker<T>>
doList(Invocation invocation)
Class<T>
getInterface()
get service type.Map<String,List<Invoker<T>>>
getMethodInvokerMap()
Haomin: added for test purposeURL
getRegisteredConsumerUrl()
URL
getUrl()
get url.Map<String,Invoker<T>>
getUrlInvokerMap()
Haomin: added for test purposeboolean
isAvailable()
is available.void
notify(List<URL> urls)
Triggered when a service change notification is received.void
setProtocol(Protocol protocol)
void
setRegisteredConsumerUrl(URL registeredConsumerUrl)
void
setRegistry(Registry registry)
void
subscribe(URL url)
static List<Configurator>
toConfigurators(List<URL> urls)
Convert override urls to map for use when re-refer.-
从类继承的方法 com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory
getConsumerUrl, getRouters, isDestroyed, list, setConsumerUrl
-
-
-
-
方法详细资料
-
toConfigurators
public static List<Configurator> toConfigurators(List<URL> urls)
Convert override urls to map for use when re-refer. Send all rules every time, the urls will be reassembled and calculated- 参数:
urls
- Contract:
1.override://0.0.0.0/...( or override://ip:port...?anyhost=true)¶1=value1... means global rules (all of the providers take effect)
2.override://ip:port...?anyhost=false Special rules (only for a certain provider)
3.override:// rule is not supported... ,needs to be calculated by registry itself.
4.override://0.0.0.0/ without parameters means clearing the override- 返回:
-
setProtocol
public void setProtocol(Protocol protocol)
-
setRegistry
public void setRegistry(Registry registry)
-
subscribe
public void subscribe(URL url)
-
destroy
public void destroy()
从接口复制的说明:Node
destroy.- 指定者:
destroy
在接口中Node
- 覆盖:
destroy
在类中AbstractDirectory<T>
-
notify
public void notify(List<URL> urls)
从接口复制的说明:NotifyListener
Triggered when a service change notification is received.Notify needs to support the contract:
1. Always notifications on the service interface and the dimension of the data type. that is, won't notify part of the same type data belonging to one service. Users do not need to compare the results of the previous notification.
2. The first notification at a subscription must be a full notification of all types of data of a service.
3. At the time of change, different types of data are allowed to be notified separately, e.g.: providers, consumers, routers, overrides. It allows only one of these types to be notified, but the data of this type must be full, not incremental.
4. If a data type is empty, need to notify a empty protocol with category parameter identification of url data.
5. The order of notifications to be guaranteed by the notifications(That is, the implementation of the registry). Such as: single thread push, queue serialization, and version comparison.- 指定者:
notify
在接口中NotifyListener
- 参数:
urls
- The list of registered information , is always not empty. The meaning is the same as the return value ofRegistryService.lookup(URL)
.
-
doList
public List<Invoker<T>> doList(Invocation invocation)
-
getInterface
public Class<T> getInterface()
从接口复制的说明:Directory
get service type.- 指定者:
getInterface
在接口中Directory<T>
- 返回:
- service type.
-
getUrl
public URL getUrl()
从接口复制的说明:Node
get url.- 指定者:
getUrl
在接口中Node
- 覆盖:
getUrl
在类中AbstractDirectory<T>
- 返回:
- url.
-
getRegisteredConsumerUrl
public URL getRegisteredConsumerUrl()
-
setRegisteredConsumerUrl
public void setRegisteredConsumerUrl(URL registeredConsumerUrl)
-
isAvailable
public boolean isAvailable()
从接口复制的说明:Node
is available.- 指定者:
isAvailable
在接口中Node
- 返回:
- available.
-
-