public class DiscoverySubscriber<T extends ClientProxy,C extends BaseClientProxyConfig> extends java.lang.Object implements ClientProxyReplacer<T,C>, DiscoveryClient
| Constructor and Description |
|---|
DiscoverySubscriber(DiscoveryConfig config,
java.lang.String clientType,
ClientProxySwitcher<T,C> switcher,
boolean allowNoTarget) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkDiscovery() |
void |
close()
Called if this instance will no longer be called to replace proxies.
|
java.lang.String |
getCurrentDiscoveryProperty(java.lang.String key) |
DiscoveryResult |
getCurrentDiscoveryResult() |
ClientProxySwitcher<T,C> |
getSwitcher() |
boolean |
needToReplace()
Indicate if we need to do the replace.
|
void |
onDiscoveryPropertiesChange(DiscoveryResult discoveryResult) |
T |
replace(T oldProxy,
C config)
Replace the old proxy with a configured new instance of the same proxy type.
|
public DiscoverySubscriber(DiscoveryConfig config, java.lang.String clientType, ClientProxySwitcher<T,C> switcher, boolean allowNoTarget)
public ClientProxySwitcher<T,C> getSwitcher()
public void checkDiscovery()
public void close()
ClientProxyReplacerclose in interface ClientProxyReplacer<T extends ClientProxy,C extends BaseClientProxyConfig>public void onDiscoveryPropertiesChange(DiscoveryResult discoveryResult)
onDiscoveryPropertiesChange in interface DiscoveryClientpublic boolean needToReplace()
ClientProxyReplacerneedToReplace in interface ClientProxyReplacer<T extends ClientProxy,C extends BaseClientProxyConfig>public T replace(T oldProxy, C config)
ClientProxyReplacerreplace in interface ClientProxyReplacer<T extends ClientProxy,C extends BaseClientProxyConfig>oldProxy - the old proxy to be replaced.config - the proxy configuration.public DiscoveryResult getCurrentDiscoveryResult()
public java.lang.String getCurrentDiscoveryProperty(java.lang.String key)
Copyright © 2020–2022 Axual B.V.. All rights reserved.