类 ZookeeperServiceDiscovery
- java.lang.Object
-
- org.apache.dubbo.registry.client.AbstractServiceDiscovery
-
- org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscovery
-
- 所有已实现的接口:
Comparable<Prioritized>,Prioritized,ServiceDiscovery
public class ZookeeperServiceDiscovery extends AbstractServiceDiscovery
ZookeeperServiceDiscoveryimplementation based on Apache Curator X Discovery
-
-
字段概要
-
从接口继承的字段 org.apache.dubbo.common.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
构造器概要
构造器 构造器 说明 ZookeeperServiceDiscovery()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddServiceInstancesChangedListener(ServiceInstancesChangedListener listener)Add an instance ofServiceInstancesChangedListenerfor specified servicevoiddoDestroy()voiddoInitialize(URL registryURL)voiddoRegister(ServiceInstance serviceInstance)voiddoUnregister(ServiceInstance serviceInstance)voiddoUpdate(ServiceInstance serviceInstance)List<ServiceInstance>getInstances(String serviceName)Gets allservice instancesby the specified service name.Page<ServiceInstance>getInstances(String serviceName, int offset, int pageSize, boolean healthyOnly)Get thepaginationofservice instancesby the specified service name.Set<String>getServices()Gets all service namesURLgetUrl()voidremoveServiceInstancesChangedListener(ServiceInstancesChangedListener listener)unsubscribe to instances change event.voidreRegisterWatcher(ZookeeperServiceDiscoveryChangeWatcher watcher)-
从类继承的方法 org.apache.dubbo.registry.client.AbstractServiceDiscovery
destroy, getLocalInstance, initialize, isDestroy, 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, toString
-
-
-
-
方法详细资料
-
doInitialize
public void doInitialize(URL registryURL) throws Exception
- 指定者:
doInitialize在类中AbstractServiceDiscovery- 抛出:
Exception
-
getUrl
public URL getUrl()
-
doDestroy
public void doDestroy() throws Exception- 指定者:
doDestroy在类中AbstractServiceDiscovery- 抛出:
Exception
-
doRegister
public void doRegister(ServiceInstance serviceInstance)
- 指定者:
doRegister在类中AbstractServiceDiscovery
-
doUpdate
public void doUpdate(ServiceInstance serviceInstance)
- 指定者:
doUpdate在类中AbstractServiceDiscovery
-
doUnregister
public void doUnregister(ServiceInstance serviceInstance) throws RuntimeException
- 指定者:
doUnregister在类中AbstractServiceDiscovery- 抛出:
RuntimeException
-
getServices
public Set<String> getServices()
从接口复制的说明:ServiceDiscoveryGets all service names- 返回:
- non-null read-only
Set
-
getInstances
public List<ServiceInstance> getInstances(String serviceName) throws NullPointerException
从接口复制的说明:ServiceDiscoveryGets allservice instancesby the specified service name.- 参数:
serviceName- the service name- 返回:
- non-null
List - 抛出:
NullPointerException- ifserviceNameisnull
-
getInstances
public Page<ServiceInstance> getInstances(String serviceName, int offset, int pageSize, boolean healthyOnly)
从接口复制的说明:ServiceDiscoveryGet thepaginationofservice instancesby the specified service name. IfhealthyOnly == true, filter healthy instances only.
-
addServiceInstancesChangedListener
public void addServiceInstancesChangedListener(ServiceInstancesChangedListener listener) throws NullPointerException, IllegalArgumentException
从接口复制的说明:ServiceDiscoveryAdd an instance ofServiceInstancesChangedListenerfor 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- 抛出:
NullPointerExceptionIllegalArgumentException
-
removeServiceInstancesChangedListener
public void removeServiceInstancesChangedListener(ServiceInstancesChangedListener listener) throws IllegalArgumentException
从接口复制的说明:ServiceDiscoveryunsubscribe to instances change event.
-
reRegisterWatcher
public void reRegisterWatcher(ZookeeperServiceDiscoveryChangeWatcher watcher) throws Exception
- 抛出:
Exception
-
-