public static void main(final String[] args) {
    if (args.length < 1) {
      usage("Missing command");
    }

    // TODO is this only needed on 'agent server'? 'agent {start|stop|status}' technically do no run
    // any GemFire Cache
    // or DS code inside the current process.
    SystemFailure.loadEmergencyClasses();

    final AgentLauncher launcher = new AgentLauncher("Agent");

    try {
      final String command = args[0];

      if (command.equalsIgnoreCase("start")) {
        launcher.start(args);
      } else if (command.equalsIgnoreCase("server")) {
        launcher.server(args);
      } else if (command.equalsIgnoreCase("stop")) {
        launcher.stop(args);
      } else if (command.equalsIgnoreCase("status")) {
        launcher.status(args);
      } else if (command.toLowerCase().matches("-{0,2}help")) {
        if (args.length > 1) {
          final String topic = args[1];

          if (topic.equals("config")) {
            launcher.configHelp();
          } else {
            usage(String.format("No help available for %s", topic));
          }
        }

        usage("agent help");
      } else {
        usage(String.format("Unknown command: %s", command));
      }
    } catch (VirtualMachineError e) {
      SystemFailure.initiateFailure(e);
      throw e;
    } catch (Throwable t) {
      SystemFailure.checkFailure();
      t.printStackTrace();
      System.err.println(
          String.format("Error : %s", t.getLocalizedMessage()));
      ExitCode.FATAL.doSystemExit();
    }
  }
Bootstrap method to launch the GemFire JMX Agent process to monitor and manage a GemFire
Distributed System/Cache. Main will read the arguments passed on the command line and dispatch
the command to the appropriate handler.
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java