Annotation Interface RPCChained


@Documented @Target(METHOD) @Retention(RUNTIME) public @interface RPCChained
Indicates that a method should be implemented using an RPC chain invocation. This is only needed if the target api class is generated using the RPC code generator.
Since:
4.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Sets the base implementation class to use when generating the implementation for the chained RPC.
    int
    The flags to pass to the implementation builder when constructing the api implementation.
    int[]
    A mapping that defines how parameters should be passed into the constructor of the implemented class.
  • Element Details

    • generationFlags

      int generationFlags
      The flags to pass to the implementation builder when constructing the api implementation.
      Returns:
      the flags to pass to the implementation builder when constructing the api implementation.
      Default:
      1
    • baseImplementation

      Class<?> baseImplementation
      Sets the base implementation class to use when generating the implementation for the chained RPC. If not given then the class that is returned from the method is used as a base. Note that the value of this method must be a subtype of the type returned by the annotated method, and handlers must be registered to the return type of the annotated method, not the base implementation type.
      Returns:
      the base implementation class to use when generating an api implementation.
      Default:
      java.lang.Object.class
    • parameterMapping

      int[] parameterMapping
      A mapping that defines how parameters should be passed into the constructor of the implemented class. If the array is empty no parameters will be passed to the constructor. The array has a format of index to index mappings. The first index defines the parameter index on the method it's declared on, the second index defines where that parameter is located on the target constructor.

      Example:

      // maps parameter 0 (in this case named param1) to the second constructor parameter of the target class and
      // parameter 2 (in this case named param3) to the first constructor parameter
      @RPCChained(parameterMapping = {0, 1, 2, 0})
      String myCoolMethod(String param1, String param2, int param3) {} // example declaration, does not work
      
      Returns:
      the mapping for the parameter of the method to the constructor parameters.
      Default:
      {}