public void handle(String endpointId, JsonRpcParams params) throws JsonRpcException { checkNotNull(endpointId, "Endpoint ID must not be null"); checkArgument(!endpointId.isEmpty(), "Endpoint ID must not be empty"); checkNotNull(params, "Params must not be null"); Log.debug(getClass(), "Handling notification from: " + endpointId + ", with params: " + params); biOperation.apply(endpointId, params.getAs(paramsClass)); }
/** * Define a function to be applied * * @param function function */ public void withFunction(JsonRpcRequestBiFunction<P, R> function) { checkNotNull(function, "Request function must not be null"); Log.debug( getClass(), "Configuring incoming request binary function for " + "method: " + method + ", " + "params object class: " + pClass + ", " + "result object class: " + rClass); RequestHandler handler = new RequestHandlerOneToOne<>(pClass, function, factory); registry.register(method, handler); }