类 SofaRegistryServiceDiscovery
- java.lang.Object
-
- org.apache.dubbo.registry.client.AbstractServiceDiscovery
-
- org.apache.dubbo.registry.sofa.SofaRegistryServiceDiscovery
-
- 所有已实现的接口:
Comparable<Prioritized>,Prioritized,ServiceDiscovery
public class SofaRegistryServiceDiscovery extends AbstractServiceDiscovery
-
-
字段概要
-
从接口继承的字段 org.apache.dubbo.common.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
构造器概要
构造器 构造器 说明 SofaRegistryServiceDiscovery()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddServiceInstancesChangedListener(ServiceInstancesChangedListener listener)Add an instance ofServiceInstancesChangedListenerfor specified servicevoiddestroy()Destroy theServiceDiscoveryvoiddoRegister(ServiceInstance serviceInstance)It should be implement in kinds of service discovers.voiddoUpdate(ServiceInstance serviceInstance)It should be implement in kinds of service discovers.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()voidinitialize(URL registryURL)Initializes theServiceDiscoveryvoidunregister(ServiceInstance serviceInstance)Unregisters an instance ofServiceInstance.-
从类继承的方法 org.apache.dubbo.registry.client.AbstractServiceDiscovery
getLocalInstance, register, update
-
从接口继承的方法 org.apache.dubbo.common.lang.Prioritized
compareTo, getPriority
-
从接口继承的方法 org.apache.dubbo.registry.client.ServiceDiscovery
dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, getDefaultPageSize, getInstances, getInstances, getInstances, removeServiceInstancesChangedListener, toString
-
-
-
-
方法详细资料
-
initialize
public void initialize(URL registryURL) throws Exception
从接口复制的说明:ServiceDiscoveryInitializes theServiceDiscovery
-
getUrl
public URL getUrl()
-
destroy
public void destroy() throws Exception从接口复制的说明:ServiceDiscoveryDestroy theServiceDiscovery- 抛出:
Exception- If met with error
-
doRegister
public void doRegister(ServiceInstance serviceInstance)
从类复制的说明:AbstractServiceDiscoveryIt should be implement in kinds of service discovers.- 指定者:
doRegister在类中AbstractServiceDiscovery
-
doUpdate
public void doUpdate(ServiceInstance serviceInstance)
从类复制的说明:AbstractServiceDiscoveryIt should be implement in kinds of service discovers.- 指定者:
doUpdate在类中AbstractServiceDiscovery
-
unregister
public void unregister(ServiceInstance serviceInstance) throws RuntimeException
从接口复制的说明:ServiceDiscoveryUnregisters an instance ofServiceInstance.- 参数:
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, and it's mandatory toaddtheServiceInstancesChangedListenerargument intoEventDispatcherwhether the subclass implements same approach or not, thus 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- 另请参阅:
EventPublishingServiceDiscovery,EventDispatcher
-
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.- 参数:
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- 返回:
-
-