monitorMBean.setNotifyHigh(true);
monitorMBean.setNotifyLow(true);
// Setup the monitor: we're interested in absolute values of the number of clients
monitorMBean.setDifferenceMode(false);
// Setup the monitor: link to the service MBean
monitorMBean.addObservedObject(serviceName);
monitorMBean.setObservedAttribute("ConcurrentClients");
// Setup the monitor: a short granularity period
monitorMBean.setGranularityPeriod(50L);
// Setup the monitor: register a listener
monitorMBean.addNotificationListener(new NotificationListener()