Interface FailoverProxyProvider<T>

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
DefaultFailoverProxyProvider

@Evolving public interface FailoverProxyProvider<T> extends Closeable
An implementer of this interface is capable of providing proxy objects for use in IPC communication, and potentially modifying these objects or creating entirely new ones in the event of certain types of failures. The determination of whether or not to fail over is handled by RetryPolicy.
  • Method Details

    • getProxy

      Get the proxy object which should be used until the next failover event occurs.
      Returns:
      the proxy object to invoke methods upon
    • performFailover

      void performFailover(T currentProxy)
      Called whenever the associated RetryPolicy determines that an error warrants failing over.
      Parameters:
      currentProxy - the proxy object which was being used before this failover event
    • getInterface

      Class<T> getInterface()
      Return a reference to the interface this provider's proxy objects actually implement. If any of the methods on this interface are annotated as being Idempotent 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.
      Returns:
      the interface implemented by the proxy objects returned by getProxy()