Interface RPCInvocationContext.Builder

All Known Implementing Classes:
DefaultRPCInvocationContextBuilder
Enclosing interface:
RPCInvocationContext

public static interface RPCInvocationContext.Builder
Represents the builder for a rpc invocation context.
Since:
4.0
  • Method Details

    • argumentCount

      @NonNull @NonNull RPCInvocationContext.Builder argumentCount(int argumentCount)
      Sets the amount of arguments the target method to invoke must have.
      Parameters:
      argumentCount - the amount of arguments the target method must have.
      Returns:
      the same builder instance as used to call the method, for chaining.
    • expectsMethodResult

      @NonNull @NonNull RPCInvocationContext.Builder expectsMethodResult(boolean expectsResult)
      Sets if the sender of the rpc expects a method result.
      Parameters:
      expectsResult - if a method result is expected.
      Returns:
      the same builder instance as used to call the method, for chaining.
    • normalizePrimitives

      @NonNull @NonNull RPCInvocationContext.Builder normalizePrimitives(boolean normalizePrimitives)
      Sets if primitives should get normalized, meaning that if a null value is returned in a call chain but the method returns a primitive type, the response will be the default value of that primitive rather than null.
      Parameters:
      normalizePrimitives - if nulls should get normalized if a primitive is expected.
      Returns:
      the same builder instance as used to call the method, for chaining.
    • strictInstanceUsage

      @NonNull @NonNull RPCInvocationContext.Builder strictInstanceUsage(boolean strictInstanceUsage)
      Sets if the handler is only allowed to use the supplied instance through the invocation context rather than the instance it is bound to (if any).
      Parameters:
      strictInstanceUsage - if the instance usage for method invocation should be strict.
      Returns:
      the same builder instance as used to call the method, for chaining.
    • methodName

      Sets the name of the method which should get invoked during the requested rpc processing.
      Parameters:
      methodName - the name of the method to call.
      Returns:
      the same builder instance as used to call the method, for chaining.
      Throws:
      NullPointerException - if the given method name is null.
    • channel

      Sets the channel from which the request to invoke the method came.
      Parameters:
      channel - the channel to which the request was sent.
      Returns:
      the same builder instance as used to call the method, for chaining.
      Throws:
      NullPointerException - if the given network channel is null.
    • argumentInformation

      Sets the buffer containing the argument information for the method invocation. The buffer is allowed to hold more information than that AFTER the method arguments.
      Parameters:
      information - the buffer holding the arguments for the method call.
      Returns:
      the same builder instance as used to call the method, for chaining.
      Throws:
      NullPointerException - if the given buffer is null.
    • workingInstance

      Sets the instance which should get used for method invocation, might be null if no specific instance should be used. If strict instance usage is active and no instance was supplied through the method, the result of the rpc invocation will always be null (or a normalized primitive value if active).
      Parameters:
      instance - the instance to use for method calls.
      Returns:
      the same builder instance as used to call the method, for chaining.
    • build

      Builds a new invocation context based on the arguments supplied to this builder.
      Returns:
      a new invocation context from this builder.
      Throws:
      NullPointerException - if either the channel, method name or argument buffer was not supplied.