Class ProtocolProxy<T>

java.lang.Object
org.apache.hadoop.ipc.ProtocolProxy<T>

public class ProtocolProxy<T> extends Object
a class wraps around a server's proxy, containing a list of its supported methods. A list of methods with a value of null indicates that the client and server have the same protocol.
  • Constructor Details

    • ProtocolProxy

      public ProtocolProxy(Class<T> protocol, T proxy, boolean supportServerMethodCheck)
      Constructor
      Parameters:
      protocol - protocol class
      proxy - its proxy
      supportServerMethodCheck - If false proxy will never fetch server methods and isMethodSupported will always return true. If true, server methods will be fetched for the first call to isMethodSupported.
  • Method Details

    • getProxy

      public T getProxy()
    • isMethodSupported

      public boolean isMethodSupported(String methodName, Class<?>... parameterTypes) throws IOException
      Check if a method is supported by the server or not.
      Parameters:
      methodName - a method's name in String format
      parameterTypes - a method's parameter types
      Returns:
      true if the method is supported by the server
      Throws:
      IOException - raised on errors performing I/O.