java.io.Closeable, java.lang.AutoCloseable, FailoverProxyProvider<T>@Evolving public class DefaultFailoverProxyProvider<T> extends java.lang.Object implements FailoverProxyProvider<T>
FailoverProxyProvider which does nothing in the
event of failover, and always returns the same proxy object.FailoverProxyProvider.ProxyInfo<T>| Constructor | Description |
|---|---|
DefaultFailoverProxyProvider(java.lang.Class<T> iface,
T proxy) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
java.lang.Class<T> |
getInterface() |
Return a reference to the interface this provider's proxy objects actually
implement.
|
FailoverProxyProvider.ProxyInfo<T> |
getProxy() |
Get the proxy object which should be used until the next failover event
occurs.
|
void |
performFailover(T currentProxy) |
Called whenever the associated
RetryPolicy determines that an error
warrants failing over. |
public java.lang.Class<T> getInterface()
FailoverProxyProviderIdempotent or AtMostOnce, then this fact will be passed to
the RetryPolicy.shouldRetry(Exception, int, int, boolean) method on
error, for use in determining whether or not failover should be attempted.getInterface in interface FailoverProxyProvider<T>FailoverProxyProvider.getProxy()public FailoverProxyProvider.ProxyInfo<T> getProxy()
FailoverProxyProvidergetProxy in interface FailoverProxyProvider<T>public void performFailover(T currentProxy)
FailoverProxyProviderRetryPolicy determines that an error
warrants failing over.performFailover in interface FailoverProxyProvider<T>currentProxy - the proxy object which was being used before this failover eventpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.