Index: src/main/java/org/glassfish/admin/monitor/MonitoringBootstrap.java =================================================================== --- src/main/java/org/glassfish/admin/monitor/MonitoringBootstrap.java (revision 62733) +++ src/main/java/org/glassfish/admin/monitor/MonitoringBootstrap.java (working copy) @@ -64,6 +64,7 @@ import org.jvnet.hk2.annotations.Optional; import org.jvnet.hk2.annotations.Service; +import org.jvnet.hk2.config.ConfigBeanProxy; import org.jvnet.hk2.config.ConfigListener; import org.jvnet.hk2.config.UnprocessedChangeEvents; @@ -508,6 +509,10 @@ if(event == null) continue; + if (!isCurrentInstanceMatchingTarget(event)) { + continue; + } + String propName = event.getPropertyName(); Object oldVal = event.getOldValue(); Object newVal = event.getNewValue(); @@ -559,6 +564,31 @@ return null; } + private boolean isCurrentInstanceMatchingTarget(PropertyChangeEvent event) { + // DAS receive all the events, so we need to figure out + // whether we should take action on DAS depending on the event. + + if(serverEnv.isInstance()) { + return true; + } + + ConfigBeanProxy proxy = (ConfigBeanProxy)(event.getSource()); + Config config; + if(proxy instanceof MonitoringService) { + config = (Config)proxy.getParent(); + } else { + config = (Config)proxy.getParent().getParent(); + } + + String name = config.getName(); + // We think that DAS's config is always server-config. + if(name.equalsIgnoreCase("server-config")) { + return true; + } + + return false; + } + private void handleLevelChange(String propName, String enabledStr) { if (logger.isLoggable(Level.FINE)) logger.fine("In handleLevelChange(), spmd = " + spmd + " Enabled="+enabledStr);