类 MultipleServiceDiscovery
- java.lang.Object
-
- org.apache.dubbo.registry.multiple.MultipleServiceDiscovery
-
- 所有已实现的接口:
Comparable<Prioritized>,Prioritized,ServiceDiscovery
public class MultipleServiceDiscovery extends Object implements ServiceDiscovery
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringREGISTRY_PREFIX_KEY-
从接口继承的字段 org.apache.dubbo.common.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
构造器概要
构造器 构造器 说明 MultipleServiceDiscovery()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddServiceInstancesChangedListener(ServiceInstancesChangedListener listener)Add an instance ofServiceInstancesChangedListenerfor specified serviceServiceInstancesChangedListenercreateListener(Set<String> serviceNames)voiddestroy()Destroy theServiceDiscoveryPage<ServiceInstance>getInstances(String serviceName, int offset, int pageSize, boolean healthyOnly)Get thepaginationofservice instancesby the specified service name.ServiceInstancegetLocalInstance()Set<String>getServices()Gets all service namesURLgetUrl()voidinitialize(URL registryURL)Initializes theServiceDiscoverybooleanisDestroy()voidregister(ServiceInstance serviceInstance)Registers an instance ofServiceInstance.voidunregister(ServiceInstance serviceInstance)Unregisters an instance ofServiceInstance.voidupdate(ServiceInstance serviceInstance)Updates the registeredServiceInstance.-
从接口继承的方法 org.apache.dubbo.common.lang.Prioritized
compareTo, getPriority
-
从接口继承的方法 org.apache.dubbo.registry.client.ServiceDiscovery
dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, getDefaultPageSize, getDelay, getInstances, getInstances, getInstances, removeServiceInstancesChangedListener, toString
-
-
-
-
方法详细资料
-
initialize
public void initialize(URL registryURL) throws Exception
从接口复制的说明:ServiceDiscoveryInitializes theServiceDiscovery- 指定者:
initialize在接口中ServiceDiscovery- 参数:
registryURL- theurlto connect service registry- 抛出:
Exception- If met with error
-
getUrl
public URL getUrl()
- 指定者:
getUrl在接口中ServiceDiscovery
-
destroy
public void destroy() throws Exception从接口复制的说明:ServiceDiscoveryDestroy theServiceDiscovery- 指定者:
destroy在接口中ServiceDiscovery- 抛出:
Exception- If met with error
-
isDestroy
public boolean isDestroy()
- 指定者:
isDestroy在接口中ServiceDiscovery
-
register
public void register(ServiceInstance serviceInstance) throws RuntimeException
从接口复制的说明:ServiceDiscoveryRegisters an instance ofServiceInstance.- 指定者:
register在接口中ServiceDiscovery- 参数:
serviceInstance- an instance ofServiceInstanceto be registered- 抛出:
RuntimeException- if failed
-
update
public void update(ServiceInstance serviceInstance) throws RuntimeException
从接口复制的说明:ServiceDiscoveryUpdates the registeredServiceInstance.- 指定者:
update在接口中ServiceDiscovery- 参数:
serviceInstance- the registeredServiceInstance- 抛出:
RuntimeException- if failed
-
unregister
public void unregister(ServiceInstance serviceInstance) throws RuntimeException
从接口复制的说明:ServiceDiscoveryUnregisters an instance ofServiceInstance.- 指定者:
unregister在接口中ServiceDiscovery- 参数:
serviceInstance- an instance ofServiceInstanceto be unregistered- 抛出:
RuntimeException- if failed
-
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- 指定者:
addServiceInstancesChangedListener在接口中ServiceDiscovery- 参数:
listener- an instance ofServiceInstancesChangedListener- 抛出:
NullPointerExceptionIllegalArgumentException
-
createListener
public ServiceInstancesChangedListener createListener(Set<String> serviceNames)
- 指定者:
createListener在接口中ServiceDiscovery
-
getInstances
public Page<ServiceInstance> getInstances(String serviceName, int offset, int pageSize, boolean healthyOnly) throws NullPointerException, IllegalArgumentException, UnsupportedOperationException
从接口复制的说明:ServiceDiscoveryGet thepaginationofservice instancesby the specified service name. IfhealthyOnly == true, filter healthy instances only.- 指定者:
getInstances在接口中ServiceDiscovery- 参数:
serviceName- the service nameoffset- the offset of request , the number "0" indicates first pagepageSize- the number of request, themax valueindicates the range is unlimitedhealthyOnly- iftrue, filter healthy instances only- 返回:
- non-null
Pageobject - 抛出:
NullPointerException- ifserviceNameisnullIllegalArgumentException- ifoffsetorpageSizeis negative numberUnsupportedOperationException- if not supported
-
getServices
public Set<String> getServices()
从接口复制的说明:ServiceDiscoveryGets all service names- 指定者:
getServices在接口中ServiceDiscovery- 返回:
- non-null read-only
Set
-
getLocalInstance
public ServiceInstance getLocalInstance()
- 指定者:
getLocalInstance在接口中ServiceDiscovery
-
-