@InterfaceStability.Evolving public class DefaultFailoverProxyProvider<T> extends Object implements FailoverProxyProvider<T>
FailoverProxyProvider which does nothing in the
event of failover, and always returns the same proxy object.| Constructor and Description |
|---|
DefaultFailoverProxyProvider(Class<T> iface,
T proxy) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Class<T> |
getInterface()
Return a reference to the interface this provider's proxy objects actually
implement.
|
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 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 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 IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.