@Override
        public void run() {
          try {
            if ((fCommand.onCommandResultListener != null) && (fOutput != null))
              fCommand.onCommandResultListener.onCommandResult(fCommand.code, fExitCode, fOutput);
            if (fCommand.onCommandLineListener != null)
              fCommand.onCommandLineListener.onCommandResult(fCommand.code, fExitCode);
          } finally {
            endCallback();
          }
        }
Schedule a callback to run on the appropriate thread
imitate/src/main/java/com/engineer/imitate/shell/Shell.java