How server method resolution works
masterWhen a request arrives, the server resolves the method using these steps (short-circuiting when 1 or fewer methods remain):
- @JsonRpcMethod: If the method has
@JsonRpcMethod(value="name"), it is considered. Ifrequired=true, the Java method name is ignored. - Name Match: Otherwise, all methods with the same name as the request are considered.
- Parameter Count (Less): If
allowLessParamsis false, methods with more parameters than the request are removed. - Parameter Count (Extra): If
allowExtraParamsis false, methods with fewer parameters than the request are removed. - Parameter Count (Proximity): If either of the above are enabled, methods with the lowest difference in parameter count are kept.
- Type Matching: Parameters are compared to request types; methods with the highest number of matching parameters are kept.
- Tie-break: If multiple methods remain, the first one is used.
Note on Overloading: Resolution works well for primitives. However, resolution between different POJOs (e.g., UserObject vs UserObjectEx) is not supported because the server cannot efficiently determine the difference in JSON structure.