public void unregisterAll() {
    try {
      ObjectName name = new ObjectName(OBJECTNAME__PREFIX + "*");
      Set<ObjectName> gemFireObjects = mbeanServer.queryNames(name, null);

      for (ObjectName objectName : gemFireObjects) {
        unregisterMBean(objectName);
      }
    } catch (MalformedObjectNameException | NullPointerException e) {
      throw new ManagementException(e);
    }

  }
Method to unregister all the local GemFire MBeans
geode-core/src/main/java/org/apache/geode/management/internal/MBeanJMXAdapter.java