Interface RPCSender

All Superinterfaces:
RPCProvider
All Known Implementing Classes:
DefaultRPCSender

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

    • factory

      Get the provider factory used to construct this rpc sender.
      Returns:
      the provider factory used to construct this rpc sender.
    • associatedComponent

      @NonNull @NonNull NetworkComponent associatedComponent()
      Get the network component associated with this rpc sender.
      Returns:
      the network component associated with this rpc sender.
      Throws:
      UnsupportedOperationException - if this sender has no network component associated.
    • invokeMethod

      @NonNull @NonNull RPC invokeMethod(@NonNull @NonNull String methodName)
      Creates a rpc to invoke the target method with no arguments, preventing a new object array allocation each time the method is invoked. Equivalent to sender.invokeMethod(name, new Object[0]).
      Parameters:
      methodName - the name of the method to invoke.
      Returns:
      the rpc usable to fire the rpc request against the given method.
      Throws:
      NullPointerException - if the given method name is null.
      CannotDecideException - if either none or multiple methods are matching the given method name.
    • invokeMethod

      @NonNull @NonNull RPC invokeMethod(@NonNull @NonNull String methodName, Object... args)
      Creates a rpc to invoke the target method with the given arguments. For this operation to succeed, the class must
      1. contain a method which equals the given method name (case sensitive)
      2. that method must have the amount of arguments supplied via the arguments array.
      Parameters:
      methodName - the name of the method to invoke.
      args - the arguments to use for the method invocation.
      Returns:
      the rpc usable to fire the rpc request against the given method.
      Throws:
      NullPointerException - if the given method name is null.
      CannotDecideException - if either none or multiple methods are matching the given method name.