类 XdsServiceDiscovery
- java.lang.Object
-
- org.apache.dubbo.registry.client.SelfHostMetaServiceDiscovery
-
- org.apache.dubbo.registry.xds.XdsServiceDiscovery
-
- 所有已实现的接口:
Comparable<Prioritized>
,Prioritized
,ServiceDiscovery
public class XdsServiceDiscovery extends SelfHostMetaServiceDiscovery
-
-
字段概要
-
从接口继承的字段 org.apache.dubbo.common.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
构造器概要
构造器 构造器 说明 XdsServiceDiscovery()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addServiceInstancesChangedListener(ServiceInstancesChangedListener listener)
Add an instance ofServiceInstancesChangedListener
for specified servicevoid
doDestroy()
void
doInitialize(URL registryURL)
List<ServiceInstance>
getInstances(String serviceName)
Gets allservice instances
by the specified service name.Set<String>
getServices()
Gets all service names-
从类继承的方法 org.apache.dubbo.registry.client.SelfHostMetaServiceDiscovery
destroy, doRegister, doUnregister, doUpdate, fillServiceInstance, getCachedServiceInstances, getLocalInstance, getUrl, initialize, isDestroy, notifyListener, register, unregister, update
-
从接口继承的方法 org.apache.dubbo.common.lang.Prioritized
compareTo, getPriority
-
从接口继承的方法 org.apache.dubbo.registry.client.ServiceDiscovery
createListener, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, getDefaultPageSize, getDelay, getInstances, getInstances, getInstances, removeServiceInstancesChangedListener, toString
-
-
-
-
方法详细资料
-
doInitialize
public void doInitialize(URL registryURL) throws Exception
- 覆盖:
doInitialize
在类中SelfHostMetaServiceDiscovery
- 抛出:
Exception
-
doDestroy
public void doDestroy() throws Exception
- 覆盖:
doDestroy
在类中SelfHostMetaServiceDiscovery
- 抛出:
Exception
-
getServices
public Set<String> getServices()
从接口复制的说明:ServiceDiscovery
Gets all service names- 返回:
- non-null read-only
Set
-
getInstances
public List<ServiceInstance> getInstances(String serviceName) throws NullPointerException
从接口复制的说明:ServiceDiscovery
Gets allservice instances
by the specified service name.- 参数:
serviceName
- the service name- 返回:
- non-null
List
- 抛出:
NullPointerException
- ifserviceName
isnull
-
addServiceInstancesChangedListener
public void addServiceInstancesChangedListener(ServiceInstancesChangedListener listener) throws NullPointerException, IllegalArgumentException
从接口复制的说明:ServiceDiscovery
Add an instance ofServiceInstancesChangedListener
for specified serviceDefault, Current method will be invoked by
the ServiceDiscoveryRegistry on the subscription
, this method is used to trigger or adapt the vendor's change notification mechanism typically, like Zookeeper Watcher, Nacos EventListener. If the registry observes the change, It's suggested that the implementation could invokeServiceDiscovery.dispatchServiceInstancesChangedEvent(String)
method or variants- 参数:
listener
- an instance ofServiceInstancesChangedListener
- 抛出:
NullPointerException
IllegalArgumentException
-
-