protected String execute(String command, InternalManagedEntity entity) {
    /*
     * TODO: this is getting ugly... clients of this method really need to have the ability to do
     * their own parsing/checking of 'output'
     */
    if (command == null || command.length() == 0) {
      throw new IllegalArgumentException(
          "Execution command is empty");
    }

    File workingDir = new File(entity.getEntityConfig().getWorkingDirectory());
    logger.info("Executing remote command: {} in directory {}",
        command, workingDir);
    Process p = null;
    try {
      p = Runtime.getRuntime().exec(command, null /* env */, workingDir);

    } catch (java.io.IOException e) {
      logger.fatal("While executing " + command, e);
      return null;
    }

    final ProcessOutputReader pos = new ProcessOutputReader(p);
    int retCode = pos.getExitCode();
    final String output = pos.getOutput();
    logger.info("Result of executing {} is {}", command, retCode);
    logger.info("Output of {} is {}", command, output);

    if (retCode != 0 || outputIsError(output)) {
      logger.warn("Remote execution of {} failed.", command);
      return null;
    }

    return output;
  }
Executes a command using {@link Runtime#exec(java.lang.String)}.

@param command The full command to remotely execute

@return Output from the command that was executed or <code>null</code> if the executing the
        command failed.
geode-core/src/main/java/org/apache/geode/admin/internal/EnabledManagedEntityController.java