类 RegistryDirectory<T>
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.directory.AbstractDirectory<T>
-
- org.apache.dubbo.registry.integration.DynamicDirectory<T>
-
- org.apache.dubbo.registry.integration.RegistryDirectory<T>
-
- 所有已实现的接口:
Node
,NotifyListener
,Directory<T>
public class RegistryDirectory<T> extends DynamicDirectory<T>
RegistryDirectory
-
-
构造器概要
构造器 构造器 说明 RegistryDirectory(Class<T> serviceType, URL url)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<Invoker<T>>
doList(Invocation invocation)
List<Invoker<T>>
getAllInvokers()
URL
getConsumerUrl()
Class<T>
getInterface()
get service type.List<Invoker<T>>
getInvokers()
URL
getRegisteredConsumerUrl()
Map<URL,Invoker<T>>
getUrlInvokerMap()
Haomin: added for test purposeboolean
isAvailable()
is available.boolean
isServiceDiscovery()
void
notify(List<URL> urls)
Triggered when a service change notification is received.void
setRegisteredConsumerUrl(URL url)
void
subscribe(URL url)
void
unSubscribe(URL url)
-
从类继承的方法 org.apache.dubbo.registry.integration.DynamicDirectory
addServiceListener, buildRouterChain, destroy, discordAddresses, getOriginalConsumerUrl, getRegistry, getSubscribeUrl, isNotificationReceived, isShouldRegister, setInvokersChangedListener, setProtocol, setRegistry, setSubscribeUrl
-
从类继承的方法 org.apache.dubbo.rpc.cluster.directory.AbstractDirectory
getRouterChain, getUrl, isDestroyed, list, setConsumerUrl, setRouterChain
-
-
-
-
方法详细资料
-
subscribe
public void subscribe(URL url)
- 覆盖:
subscribe
在类中DynamicDirectory<T>
-
unSubscribe
public void unSubscribe(URL url)
- 覆盖:
unSubscribe
在类中DynamicDirectory<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.- 参数:
urls
- The list of registered information , is always not empty. The meaning is the same as the return value ofRegistryService.lookup(URL)
.
-
isServiceDiscovery
public boolean isServiceDiscovery()
-
doList
public List<Invoker<T>> doList(Invocation invocation)
- 覆盖:
doList
在类中DynamicDirectory<T>
-
getInterface
public Class<T> getInterface()
从接口复制的说明:Directory
get service type.- 指定者:
getInterface
在接口中Directory<T>
- 覆盖:
getInterface
在类中DynamicDirectory<T>
- 返回:
- service type.
-
getAllInvokers
public List<Invoker<T>> getAllInvokers()
- 指定者:
getAllInvokers
在接口中Directory<T>
- 覆盖:
getAllInvokers
在类中DynamicDirectory<T>
-
getConsumerUrl
public URL getConsumerUrl()
- 指定者:
getConsumerUrl
在接口中Directory<T>
- 指定者:
getConsumerUrl
在接口中NotifyListener
- 覆盖:
getConsumerUrl
在类中DynamicDirectory<T>
-
getRegisteredConsumerUrl
public URL getRegisteredConsumerUrl()
- 覆盖:
getRegisteredConsumerUrl
在类中DynamicDirectory<T>
-
setRegisteredConsumerUrl
public void setRegisteredConsumerUrl(URL url)
- 覆盖:
setRegisteredConsumerUrl
在类中DynamicDirectory<T>
-
isAvailable
public boolean isAvailable()
从接口复制的说明:Node
is available.- 返回:
- available.
-
getInvokers
public List<Invoker<T>> getInvokers()
- 覆盖:
getInvokers
在类中DynamicDirectory<T>
-
-