@Override
    public String toString() {
      final StringBuilder buffer = new StringBuilder();

      if (pid == Integer.MIN_VALUE && state == SHUTDOWN && msg != null) {
        buffer.append(msg);
      } else {
        buffer.append(
            String.format("%s pid: %d status: ", baseName, pid));

        switch (state) {
          case SHUTDOWN:
            buffer.append("shutdown");
            break;
          case STARTING:
            buffer.append("starting");
            break;
          case RUNNING:
            buffer.append("running");
            break;
          case SHUTDOWN_PENDING:
            buffer.append("shutdown pending");
            break;
          case SHUTDOWN_PENDING_AFTER_FAILED_STARTUP:
            buffer.append("shutdown pending after failed startup");
            break;
          default:
            buffer.append("unknown");
            break;
        }

        if (exception != null) {
          if (msg != null) {
            buffer.append("\n").append(msg).append(" - ");
          } else {
            buffer.append("\n " + String.format("Exception in %s : %s ",
                baseName, exception.getMessage()) + " - ");
          }
          buffer
              .append("See log file for details.");
        }
      }

      return buffer.toString();
    }
A class representing the current state of the GemFire JMX Agent process. Instances of this
class are serialized to a {@linkplain #statusFileName file} on disk in the specified working
directory {@linkplain #workingDirectory}.
<p>

@see #SHUTDOWN
@see #STARTING
@see #RUNNING
@see #SHUTDOWN_PENDING
@see #SHUTDOWN_PENDING_AFTER_FAILED_STARTUP
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java