public class RegistryDirectory<T> extends AbstractDirectory<T> implements NotifyListener
| 构造器和说明 |
|---|
RegistryDirectory(Class<T> serviceType,
URL url) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
buildRouterChain(URL url) |
void |
destroy() |
List<org.apache.dubbo.rpc.Invoker<T>> |
doList(org.apache.dubbo.rpc.Invocation invocation) |
List<org.apache.dubbo.rpc.Invoker<T>> |
getAllInvokers() |
URL |
getConsumerUrl() |
Class<T> |
getInterface() |
List<org.apache.dubbo.rpc.Invoker<T>> |
getInvokers() |
URL |
getRegisteredConsumerUrl() |
Registry |
getRegistry() |
Map<String,org.apache.dubbo.rpc.Invoker<T>> |
getUrlInvokerMap()
Haomin: added for test purpose
|
boolean |
isAvailable() |
boolean |
isShouldRegister() |
void |
notify(List<URL> urls)
Triggered when a service change notification is received.
|
void |
setProtocol(org.apache.dubbo.rpc.Protocol protocol) |
void |
setRegisteredConsumerUrl(URL url) |
void |
setRegistry(Registry registry) |
void |
subscribe(URL url) |
void |
unSubscribe(URL url) |
getRouterChain, getUrl, isDestroyed, list, setConsumerUrl, setRouterChainpublic void setProtocol(org.apache.dubbo.rpc.Protocol protocol)
public void setRegistry(Registry registry)
public Registry getRegistry()
public boolean isShouldRegister()
public void subscribe(URL url)
public void unSubscribe(URL url)
public void destroy()
destroy 在接口中 Nodedestroy 在类中 AbstractDirectory<T>public void notify(List<URL> urls)
NotifyListener
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 在接口中 NotifyListenerurls - The list of registered information , is always not empty. The meaning is the same as the return value of RegistryService.lookup(URL).public List<org.apache.dubbo.rpc.Invoker<T>> doList(org.apache.dubbo.rpc.Invocation invocation)
doList 在类中 AbstractDirectory<T>public Class<T> getInterface()
getInterface 在接口中 Directory<T>public List<org.apache.dubbo.rpc.Invoker<T>> getAllInvokers()
getAllInvokers 在接口中 Directory<T>public URL getConsumerUrl()
getConsumerUrl 在接口中 Directory<T>getConsumerUrl 在类中 AbstractDirectory<T>public URL getRegisteredConsumerUrl()
public void setRegisteredConsumerUrl(URL url)
public boolean isAvailable()
isAvailable 在接口中 Nodepublic void buildRouterChain(URL url)
public Map<String,org.apache.dubbo.rpc.Invoker<T>> getUrlInvokerMap()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.