code: protected void runCommand(String commandName, CommandInterpreter interpreter) {
          PrintWriter out = new PrintWriter(new CommandInterpreterWriter(interpreter));
          String[] args = fetchCommandParams(interpreter);
          try {
              Method method = service.getClass().getMethod(commandName, PrintWriter.class, String[].class);
              method.invoke(service, out, args);
          } catch (NoSuchMethodException e) {
              out.println("No such command: " + commandName);
          } catch (Exception e) {
              LOG.log(Level.WARNING, "Unable to execute command: " + commandName + " with args: " + Arrays.toString(args), e);
              e.printStackTrace(out);
          }
      }
docs: Run command method
  
  @param commandName command name
  @param interpreter interpreter