will be middleware interface using Optional<JsonRpcResponse> to support both standard calls and notifications. Enforces an exception-
safe architecture by requiring errors to be returned in the response.
public interface JsonRpcInvoker {
Optional<JsonRpcResponse> invoke(Context ctx, JsonRpcRequest request, JsonRpcChain next);
}
They can be chained by:
{
install(new JsonRpcModule(...)
.invoker((ctx, req, next) -> {
// do something before call
var rsp = next.proceed(ctx, req);
// do something after
return rsp;
})
);
}
will be middleware interface using
Optional<JsonRpcResponse>to support both standard calls and notifications. Enforces an exception-safe architecture by requiring errors to be returned in the response.
They can be chained by:
{ install(new JsonRpcModule(...) .invoker((ctx, req, next) -> { // do something before call var rsp = next.proceed(ctx, req); // do something after return rsp; }) ); }