filter.enableAllObjectNames();
_server.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this, filter, null);
}
public void handleNotification(Notification notification, Object handback) {
MBeanServerNotification mbs = (MBeanServerNotification) notification;
if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(mbs.getType())) {
if (mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain)) {
_logger.info("MBean Registered, name :" + mbs.getMBeanName());
onMBeanRegistered(_server, mbs);
}
} else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(mbs.getType())) {
if (mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain)) {
_logger.info("MBean Unregistered, name :" + mbs.getMBeanName());
onMBeanUnRegistered(_server, mbs);
}
}
}