Interface RPCSender

All Superinterfaces:
RPCProvider

public interface RPCSender extends RPCProvider
A sender which can send rpc requests to another network component.
Since:
4.0
  • Method Details

    • invokeCaller

      @NonNull @NonNull RPC invokeCaller(Object... args)
      Returns a new RPC that can invoke the calling method with the provided arguments.
      Parameters:
      args - the arguments to supply when invoking the method.
      Returns:
      an RPC that calls the caller method on a remote component with the provided arguments.
      Throws:
      IllegalStateException - if the calling method cannot be resolved.
      IllegalArgumentException - if the calling method is not known in the target class.
    • invokeCallerWithOffset

      @NonNull @NonNull RPC invokeCallerWithOffset(int callerStackOffset, Object... args)
      Returns a new RPC that can invoke the calling method with the provided arguments.
      Parameters:
      callerStackOffset - the offset on the stack where the target method is located.
      args - the arguments to supply when invoking the method.
      Returns:
      an RPC that calls the caller method on a remote component with the provided arguments.
      Throws:
      IllegalStateException - if the calling method cannot be resolved.
      IllegalArgumentException - if the calling method is not known in the target class.
    • invokeMethod

      @NonNull @NonNull RPC invokeMethod(@NonNull @NonNull String methodName, Object... args)
      Tries to resolve a distinct method with the given name and argument count in the target class and returns a new RPC that can invoke the resolved method with the provided arguments.
      Parameters:
      methodName - the name of the method to invoke.
      args - the arguments to supply when invoking the method.
      Returns:
      an RPC to invoke the resolved method with the given name and parameter count on the remote.
      Throws:
      NullPointerException - if the given method name or arguments array is null.
      IllegalArgumentException - if the method to call cannot be resolved in the target class.
    • invokeMethod

      @NonNull @NonNull RPC invokeMethod(@NonNull @NonNull String methodName, @NonNull @NonNull TypeDescriptor methodDesc, Object... args)
      Returns a new RPC that can invoke the method with the given name and descriptor.
      Parameters:
      methodName - the name of the method to invoke.
      methodDesc - the descriptor of the method to invoke.
      args - the arguments to supply for the method invocation.
      Returns:
      an RPC to invoke the resolved method with the given parameters on a remote.
      Throws:
      NullPointerException - if the given method name, method descriptor or argument array is null.
      IllegalArgumentException - if the method to call cannot be resolved in the target class.