public class ServiceInstancesChangedListener extends Object
The operations of ServiceInstancesChangedListener should be synchronized.
| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceInstancesChangedListener.NotifyListenerWithKey |
static class |
ServiceInstancesChangedListener.ProtocolServiceKeyWithUrls |
| Constructor and Description |
|---|
ServiceInstancesChangedListener(Set<String> serviceNames,
ServiceDiscovery serviceDiscovery) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListenerAndNotify(URL url,
NotifyListener listener) |
void |
destroy()
Since this listener is shared among interfaces, destroy this listener only when all interface listener are unsubscribed
|
boolean |
equals(Object o) |
Map<String,List<ServiceInstance>> |
getAllInstances() |
Set<String> |
getServiceNames()
Get the correlative service name
|
URL |
getUrl() |
int |
hashCode() |
boolean |
hasListeners() |
boolean |
isDestroyed() |
void |
onEvent(ServiceInstancesChangedEvent event)
|
void |
removeListener(String serviceKey,
NotifyListener notifyListener) |
void |
setUrl(URL url) |
public ServiceInstancesChangedListener(Set<String> serviceNames, ServiceDiscovery serviceDiscovery)
public void onEvent(ServiceInstancesChangedEvent event)
event - ServiceInstancesChangedEventpublic void addListenerAndNotify(URL url, NotifyListener listener)
public void removeListener(String serviceKey, NotifyListener notifyListener)
public boolean hasListeners()
public final Set<String> getServiceNames()
public void setUrl(URL url)
public URL getUrl()
public Map<String,List<ServiceInstance>> getAllInstances()
public void destroy()
public boolean isDestroyed()
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.