public static CommandService getUsableLocalCommandService() {
    if (localCommandService != null && localCommandService.isUsable()) {
      return localCommandService;
    }

    return null;
  }
Returns an existing 'usable' <code>CommandService</code>. A <code>CommandService</code> is
considered usable if at has an underlying <code>Cache</code> which is not closed.

@return A usable <code>CommandService</code> or null if one cannot be found.
geode-gfsh/src/main/java/org/apache/geode/management/cli/CommandService.java