@Override
  public boolean isConnected() {
    if (dm == null) {
      return false;
    }
    if (dm.getCancelCriterion().isCancelInProgress()) {
      return false;
    }
    if (isDisconnecting) {
      return false;
    }
    return isConnected;
  }
Checks whether or not this connection to a distributed system is closed.

@throws DistributedSystemDisconnectedException This connection has been
        {@link #disconnect(boolean, String, boolean) disconnected}
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java