public class EurekaServiceDiscovery extends Object implements ServiceDiscovery
ServiceDiscovery implementation based on Eureka APICOMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY| Constructor and Description |
|---|
EurekaServiceDiscovery() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the
ServiceDiscovery |
List<ServiceInstance> |
getInstances(String serviceName)
Gets all
service instances by the specified service name. |
Set<String> |
getServices()
Gets all service names
|
void |
initialize(URL registryURL)
Initializes the
ServiceDiscovery |
void |
register(ServiceInstance serviceInstance)
Registers an instance of
ServiceInstance. |
void |
unregister(ServiceInstance serviceInstance)
Unregisters an instance of
ServiceInstance. |
void |
update(ServiceInstance serviceInstance)
Updates the registered
ServiceInstance. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddServiceInstancesChangedListener, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, dispatchServiceInstancesChangedEvent, getDefaultPageSize, getInstances, getInstances, getInstances, toStringcompareTo, getPrioritypublic void initialize(URL registryURL) throws Exception
ServiceDiscoveryServiceDiscoveryinitialize in interface ServiceDiscoveryregistryURL - the url to connect service registryException - If met with errorpublic void destroy()
throws Exception
ServiceDiscoveryServiceDiscoverydestroy in interface ServiceDiscoveryException - If met with errorpublic void register(ServiceInstance serviceInstance) throws RuntimeException
ServiceDiscoveryServiceInstance.register in interface ServiceDiscoveryserviceInstance - an instance of ServiceInstance to be registeredRuntimeException - if failedpublic void update(ServiceInstance serviceInstance) throws RuntimeException
ServiceDiscoveryServiceInstance.update in interface ServiceDiscoveryserviceInstance - the registered ServiceInstanceRuntimeException - if failedpublic void unregister(ServiceInstance serviceInstance) throws RuntimeException
ServiceDiscoveryServiceInstance.unregister in interface ServiceDiscoveryserviceInstance - an instance of ServiceInstance to be deregisteredRuntimeException - if failedpublic Set<String> getServices()
ServiceDiscoverygetServices in interface ServiceDiscoverySetpublic List<ServiceInstance> getInstances(String serviceName) throws NullPointerException
ServiceDiscoveryservice instances by the specified service name.getInstances in interface ServiceDiscoveryserviceName - the service nameListNullPointerException - if serviceName is null is nullCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.