static public void addNotificationListener(JMXConnector jmxConnector,Class<?> mbeanClass,NotificationListener notificationListener) throws InstanceNotFoundException, Exception {
  MBeanServerConnection mbsc=jmxConnector.getMBeanServerConnection();
  ObjectName objectName=generateMBeanObjectName(mbeanClass);
  mbsc.addNotificationListener(objectName,notificationListener,null,null);
}

static public void addNotificationListener ( JMXConnector jmxConnector , Class < ? > mbeanClass , NotificationListener notificationListener ) throws InstanceNotFoundException , Exception { MBeanServerConnection mbsc = jmxConnector . getMBeanServerConnection ( ) ; ObjectName objectName = generateMBeanObjectName ( mbeanClass ) ; mbsc . addNotificationListener ( objectName , notificationListener , null , null ) ; }
attach notificationlistener that can be used to listen notifications emitted by mbean server .
