code: protected void registerForMBeanNotifications() {
          Set<MBeanServerConnection> servers = getMBeanServers();
          Exception lastExp = null;
          StringBuilder errors = new StringBuilder();
          for (MBeanServerConnection server : servers) {
              try {
                  JmxUtil.addMBeanRegistrationListener(server,this,null);
              } catch (IllegalStateException e) {
                  lastExp = updateErrorMsg(errors,e);
              }
          }
          if (lastExp != null) {
              throw new IllegalStateException(errors.substring(0,errors.length()-1),lastExp);
          }
      }
docs: Add this executor as listener for MBeanServer notification so that we can update
  the local timestamp for when the set of registered MBeans has changed last.