Package org.apache.dubbo.registry.client
Interface ServiceDiscovery
- All Superinterfaces:
Comparable<Prioritized>,Prioritized,RegistryService
- All Known Implementing Classes:
AbstractServiceDiscovery,NopServiceDiscovery,ReflectionBasedServiceDiscovery
Defines the common operations of Service Discovery, extended and loaded by ServiceDiscoveryFactory
-
Field Summary
Fields inherited from interface org.apache.dubbo.common.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddefault ServiceInstancesChangedListenercreateListener(Set<String> serviceNames) voiddestroy()Destroy theServiceDiscoverydefault longgetDelay()getInstances(String serviceName) default MetadataInfogetLocalMetadata(String revision) getRemoteMetadata(String revision) getRemoteMetadata(String revision, List<ServiceInstance> instances) Gets all service namesdefault URLgetUrl()default booleanGet services is the default way for service discovery to be availablebooleanvoidregister()default voidunsubscribe to instance change event.toString()A human-readable description of the implementationvoidvoidupdate()Methods inherited from interface org.apache.dubbo.common.lang.Prioritized
compareTo, getPriorityMethods inherited from interface org.apache.dubbo.registry.RegistryService
lookup, register, subscribe, unregister, unsubscribe
-
Method Details
-
register
- Throws:
RuntimeException
-
update
- Throws:
RuntimeException
-
unregister
- Throws:
RuntimeException
-
getServices
Gets all service names- Returns:
- non-null read-only
Set
-
getInstances
- Throws:
NullPointerException
-
addServiceInstancesChangedListener
default void addServiceInstancesChangedListener(ServiceInstancesChangedListener listener) throws NullPointerException, IllegalArgumentException -
removeServiceInstancesChangedListener
default void removeServiceInstancesChangedListener(ServiceInstancesChangedListener listener) throws IllegalArgumentException unsubscribe to instance change event.- Parameters:
listener-- Throws:
IllegalArgumentException
-
createListener
-
getLocalInstance
ServiceInstance getLocalInstance() -
getLocalMetadata
MetadataInfo getLocalMetadata() -
getLocalMetadata
-
getRemoteMetadata
-
getRemoteMetadata
-
destroy
Destroy theServiceDiscovery- Throws:
Exception- If met with error
-
isDestroy
boolean isDestroy() -
getUrl
-
getDelay
default long getDelay() -
isAvailable
default boolean isAvailable()Get services is the default way for service discovery to be available -
toString
String toString()A human-readable description of the implementation
-