Package com.networknt.registry.support
Class FailbackRegistry
- java.lang.Object
-
- com.networknt.registry.support.FailbackRegistry
-
- All Implemented Interfaces:
DiscoveryService,Registry,RegistryService
- Direct Known Subclasses:
CommandFailbackRegistry
public abstract class FailbackRegistry extends Object
Failback registry- Author:
- fishermen
-
-
Field Summary
Fields Modifier and Type Field Description protected StringregistryClassName
-
Constructor Summary
Constructors Constructor Description FailbackRegistry(URL url)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidavailable(URL url)set service status to available, so clients could use itList<URL>discover(URL url)protected abstract voiddoAvailable(URL url)protected abstract List<URL>doDiscover(URL url)protected abstract voiddoRegister(URL url)protected abstract voiddoSubscribe(URL url, NotifyListener listener)protected abstract voiddoUnavailable(URL url)protected abstract voiddoUnregister(URL url)protected abstract voiddoUnsubscribe(URL url, NotifyListener listener)Collection<URL>getRegisteredServiceUrls()URLgetUrl()protected voidnotify(URL refUrl, NotifyListener listener, List<URL> urls)voidregister(URL url)register service to registryvoidsubscribe(URL url, NotifyListener listener)voidunavailable(URL url)set service status to unavailable, client should not discover services of unavailable statevoidunregister(URL url)unregister service to registryvoidunsubscribe(URL url, NotifyListener listener)
-
-
-
Field Detail
-
registryClassName
protected String registryClassName
-
-
Constructor Detail
-
FailbackRegistry
public FailbackRegistry(URL url)
-
-
Method Detail
-
register
public void register(URL url)
Description copied from interface:RegistryServiceregister service to registry- Specified by:
registerin interfaceRegistryService- Parameters:
url- a URL object
-
unregister
public void unregister(URL url)
Description copied from interface:RegistryServiceunregister service to registry- Specified by:
unregisterin interfaceRegistryService- Parameters:
url- a URL object
-
subscribe
public void subscribe(URL url, NotifyListener listener)
- Specified by:
subscribein interfaceDiscoveryService
-
unsubscribe
public void unsubscribe(URL url, NotifyListener listener)
- Specified by:
unsubscribein interfaceDiscoveryService
-
discover
public List<URL> discover(URL url)
- Specified by:
discoverin interfaceDiscoveryService
-
getRegisteredServiceUrls
public Collection<URL> getRegisteredServiceUrls()
- Specified by:
getRegisteredServiceUrlsin interfaceRegistryService
-
available
public void available(URL url)
Description copied from interface:RegistryServiceset service status to available, so clients could use it- Specified by:
availablein interfaceRegistryService- Parameters:
url- service url to be available, null means all services
-
unavailable
public void unavailable(URL url)
Description copied from interface:RegistryServiceset service status to unavailable, client should not discover services of unavailable state- Specified by:
unavailablein interfaceRegistryService- Parameters:
url- service url to be unavailable, null means all services
-
notify
protected void notify(URL refUrl, NotifyListener listener, List<URL> urls)
-
doRegister
protected abstract void doRegister(URL url)
-
doUnregister
protected abstract void doUnregister(URL url)
-
doSubscribe
protected abstract void doSubscribe(URL url, NotifyListener listener)
-
doUnsubscribe
protected abstract void doUnsubscribe(URL url, NotifyListener listener)
-
doAvailable
protected abstract void doAvailable(URL url)
-
doUnavailable
protected abstract void doUnavailable(URL url)
-
-