コード例 #1
0
  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);
      }
    }
  }
コード例 #2
0
 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;
 }
コード例 #3
0
  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);
        }
      }
    }
  }
コード例 #4
0
 // 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);
         }
       }
     }
   }
 }