- /**
- * Checks if method is RPC invocation.
- *
- * @param possibleMethod
- * Method to check
- * @return true if method is RPC invocation, false otherwise.
- */
- public static boolean isRpcMethod(final Method possibleMethod) {
- return possibleMethod != null && RpcService.class.isAssignableFrom(possibleMethod.getDeclaringClass())
- && ListenableFuture.class.isAssignableFrom(possibleMethod.getReturnType())
- // length <= 2: it seemed to be impossible to get correct RpcMethodInvoker because of
- // resolveRpcInputClass() check.While RpcMethodInvoker counts with one argument for
- // non input type and two arguments for input type, resolveRpcInputClass() counting
- // with zero for non input and one for input type
- && possibleMethod.getParameterCount() <= 2;
- }
-