Class ProxyCombiner

java.lang.Object
org.apache.hadoop.ipc.ProxyCombiner

public final class ProxyCombiner extends Object
A utility class used to combine two protocol proxies. See combine(Class, Object...).
  • Method Details

    • combine

      public static <T> T combine(Class<T> combinedProxyInterface, Object... proxies)
      Combine two or more proxies which together comprise a single proxy interface. This can be used for a protocol interface which extends multiple other protocol interfaces. The returned proxy will implement all of the methods of the combined proxy interface, delegating calls to which proxy implements that method. If multiple proxies implement the same method, the first in the list will be used for delegation.

      This will check that every method on the combined interface is implemented by at least one of the supplied proxy objects.

      Type Parameters:
      T - The type of the proxy that will be returned.
      Parameters:
      combinedProxyInterface - The interface of the combined proxy.
      proxies - The proxies which should be used as delegates.
      Returns:
      The combined proxy.