public void unregisterAllGmbal() {
    /* We do this when the mbean-enabled is turned off from on */

    if (logger.isLoggable(Level.FINE))
      logger.fine("Unregistering all the statsProviders whose enabled flag is 'off' with Gmbal");
    for (StatsProviderRegistryElement spre : statsProviderRegistry.getSpreList()) {
      if (spre.isEnabled()) {
        unregisterGmbal(spre);
      }
    }
  }
 public boolean isStatsProviderRegistered(Object statsProvider, String subTreePath) {
   boolean isStatsProviderRegistered = false;
   Collection<StatsProviderRegistry.StatsProviderRegistryElement> spreList =
       statsProviderRegistry.getSpreList();
   for (StatsProviderRegistry.StatsProviderRegistryElement spre : spreList) {
     if (spre.getStatsProvider().equals(statsProvider)
         && spre.getMBeanName().equals(subTreePath)) {
       isStatsProviderRegistered = true;
     }
   }
   return isStatsProviderRegistered;
 }
  public void registerAllGmbal() {
    /* We do this when the mbean-enabled is turned on from off */

    if (logger.isLoggable(Level.FINE))
      logger.fine("Registering all the statsProviders whose enabled flag is 'on' with Gmbal");
    for (StatsProviderRegistryElement spre : statsProviderRegistry.getSpreList()) {
      if (spre.isEnabled()) {
        ManagedObjectManager mom = spre.getManagedObjectManager();
        if (mom == null) {
          mom = registerGmbal(spre.getStatsProvider(), spre.getMBeanName());
          spre.setManagedObjectManager(mom);
        }
      }
    }
  }
 // Called when AMX DomainRoot is loaded (when jconsole or gui is started)
 // Register statsProviders with gmbal whose configElement is enabled
 // Save mom in the spre.  Used in unregister with gmbal later for config change to OFF or undeploy
 // Set AMXReady flag to true
 @Override
 public void mbeanRegistered(final ObjectName objectName, final MBeanListener listener) {
   super.mbeanRegistered(objectName, listener);
   AMXReady = true;
   statsProviderRegistry.setAMXReady(true);
   if (this.getMbeanEnabledValue()) {
     for (StatsProviderRegistry.StatsProviderRegistryElement spre :
         statsProviderRegistry.getSpreList()) {
       if (spre.isEnabled()) {
         ManagedObjectManager mom = spre.getManagedObjectManager();
         if (mom == null) {
           mom = registerGmbal(spre.getStatsProvider(), spre.getMBeanName());
           spre.setManagedObjectManager(mom);
         }
       }
     }
   }
 }