private void cleanUpMonitors() {
    MemberMBean memberMBean = (MemberMBean) service.getMemberMXBean();
    if (memberMBean != null) {
      memberMBean.stopMonitor();
    }

    Set<GatewaySender> gatewaySenders = internalCache.getGatewaySenders();

    if (gatewaySenders != null && !gatewaySenders.isEmpty()) {
      for (GatewaySender gatewaySender : gatewaySenders) {
        GatewaySenderMBean gatewaySenderMBean =
            (GatewaySenderMBean) service.getLocalGatewaySenderMXBean(gatewaySender.getId());
        if (gatewaySenderMBean != null) {
          gatewaySenderMBean.stopMonitor();
        }
      }
    }

    GatewayReceiverMBean gatewayReceiverMBean =
        (GatewayReceiverMBean) service.getLocalGatewayReceiverMXBean();
    if (gatewayReceiverMBean != null) {
      gatewayReceiverMBean.stopMonitor();
    }
  }
Assumption is its a cache server instance. For Gateway receiver there will be a separate method
geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java