- public void handleCommand(final T request, final OutputWriter outputWriter) throws CommandException {
- command.handleCommand(request, m, outputWriter);
+ public void handleCommand(final T request, final JsonWriter jsonWriter) throws CommandException {
+ command.handleCommand(request, m, jsonWriter);
+ }
+
+ @Override
+ public TypeReference<T> getRequestType() {
+ return command.getRequestType();
+ }
+ }
+
+ private record RegistrationCommandRunnerImpl<T>(
+ RegistrationManager m, MultiAccountManager c, JsonRpcRegistrationCommand<T> command
+ ) implements CommandRunner<T> {
+
+ @Override
+ public void handleCommand(final T request, final JsonWriter jsonWriter) throws CommandException {
+ command.handleCommand(request, m, jsonWriter);
+ }
+
+ @Override
+ public TypeReference<T> getRequestType() {
+ return command.getRequestType();
+ }
+ }
+
+ private record MultiCommandRunnerImpl<T>(
+ MultiAccountManager c, JsonRpcMultiCommand<T> command
+ ) implements CommandRunner<T> {
+
+ @Override
+ public void handleCommand(final T request, final JsonWriter jsonWriter) throws CommandException {
+ command.handleCommand(request, c, jsonWriter);