public boolean hasNotificationSupport(ObjectName objectName){
  try {
    if (!isRegistered(objectName)) {
      return false;
    }
    ObjectInstance instance=mbeanServer.getObjectInstance(objectName);
    String className=instance.getClassName();
    Class cls=ClassLoadUtil.classFromName(className);
    Type[] intfTyps=cls.getGenericInterfaces();
    for (int i=0; i < intfTyps.length; i++) {
      Class intfTyp=(Class)intfTyps[i];
      if (intfTyp.equals(NotificationEmitter.class)) {
        return true;
      }
    }
    Class supreClassTyp=(Class)cls.getGenericSuperclass();
    if (supreClassTyp != null && supreClassTyp.equals(NotificationBroadcasterSupport.class)) {
      return true;
    }
  }
 catch (  InstanceNotFoundException e) {
    throw new ManagementException(e);
  }
catch (  ClassNotFoundException e) {
    throw new ManagementException(e);
  }
  return false;
}

public boolean hasNotificationSupport ( ObjectName objectName ) { try { if ( ! isRegistered ( objectName ) ) { return false ; } ObjectInstance instance = mbeanServer . getObjectInstance ( objectName ) ; String className = instance . getClassName ( ) ; Class cls = ClassLoadUtil . classFromName ( className ) ; Type [ ] intfTyps = cls . getGenericInterfaces ( ) ; for ( int i = 0 ; i < intfTyps . length ; i ++ ) { Class intfTyp = ( Class ) intfTyps [ i ] ; if ( intfTyp . equals ( NotificationEmitter . class ) ) { return true ; } } Class supreClassTyp = ( Class ) cls . getGenericSuperclass ( ) ; if ( supreClassTyp != null && supreClassTyp . equals ( NotificationBroadcasterSupport . class ) ) { return true ; } } catch ( InstanceNotFoundException e ) { throw new ManagementException ( e ) ; } catch ( ClassNotFoundException e ) { throw new ManagementException ( e ) ; } return false ; }
checks whether an mbean implements notification support classes or not
