private void loadGeodeCommands() {
    ServiceLoader<CommandMarker> commandMarkers =
        ServiceLoader.load(CommandMarker.class, ClassPathLoader.getLatest().asClassLoader());

    boolean loadedAtLeastOneCommand = false;
    for (CommandMarker commandMarker : commandMarkers) {
      add(commandMarker);
      loadedAtLeastOneCommand = true;
    }
    if (!loadedAtLeastOneCommand) {
      throw new IllegalStateException(
          "Required Command classes were not loaded. Check logs for errors.");
    }
  }
Loads commands via {@link ServiceLoader} from {@link ClassPathLoader}.

@since GemFire 8.1
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/CommandManager.java