private void stopManagingActivity() {
    try {
      executorService.get().shutdownNow();

      for (DistributedMember distributedMember : repo.getMonitoringRegionMap().keySet()) {
        removeMemberArtifacts(distributedMember, false);
      }
    } catch (Exception e) {
      throw new ManagementException(e);
    }
  }
This method will be invoked whenever a member stops being a managing node. The
{@code ManagementException} has to be handled by the caller.
geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java