public abstract class AbstractRegistry extends Object implements Registry
Abstract registry。 对进出的url都进行createCopy保护,避免registry中的对象被修改,避免潜在的并发问题。
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
registryClassName |
| 构造器和说明 |
|---|
AbstractRegistry(URL url) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
available(URL url)
set service status to available, so clients could use it
|
List<URL> |
discover(URL url) |
protected abstract void |
doAvailable(URL url) |
protected abstract List<URL> |
doDiscover(URL url) |
protected abstract void |
doRegister(URL url) |
protected abstract void |
doSubscribe(URL url,
NotifyListener listener) |
protected abstract void |
doUnavailable(URL url) |
protected abstract void |
doUnregister(URL url) |
protected abstract void |
doUnsubscribe(URL url,
NotifyListener listener) |
protected List<URL> |
getCachedUrls(URL url) |
Collection<URL> |
getRegisteredServiceUrls() |
URL |
getUrl() |
protected void |
notify(URL refUrl,
NotifyListener listener,
List<URL> urls) |
void |
register(URL url)
register service to registry
|
void |
subscribe(URL url,
NotifyListener listener) |
void |
unavailable(URL url)
set service status to unavailable, client should not discover services of unavailable state
|
void |
unregister(URL url)
unregister service to registry
|
void |
unsubscribe(URL url,
NotifyListener listener) |
protected String registryClassName
public AbstractRegistry(URL url)
public void register(URL url)
RegistryServiceregister 在接口中 RegistryServicepublic void unregister(URL url)
RegistryServiceunregister 在接口中 RegistryServicepublic void subscribe(URL url, NotifyListener listener)
subscribe 在接口中 DiscoveryServicepublic void unsubscribe(URL url, NotifyListener listener)
unsubscribe 在接口中 DiscoveryServicepublic List<URL> discover(URL url)
discover 在接口中 DiscoveryServicepublic Collection<URL> getRegisteredServiceUrls()
getRegisteredServiceUrls 在接口中 RegistryServicepublic void available(URL url)
RegistryServiceavailable 在接口中 RegistryServiceurl - service url to be available, null means all servicespublic void unavailable(URL url)
RegistryServiceunavailable 在接口中 RegistryServiceurl - service url to be unavailable, null means all servicesprotected void notify(URL refUrl, NotifyListener listener, List<URL> urls)
protected abstract void doRegister(URL url)
protected abstract void doUnregister(URL url)
protected abstract void doSubscribe(URL url, NotifyListener listener)
protected abstract void doUnsubscribe(URL url, NotifyListener listener)
protected abstract void doAvailable(URL url)
protected abstract void doUnavailable(URL url)
Copyright © 2017. All rights reserved.