MX4JModelMBean.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:gemfirexd-oss 作者:
public void addAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws MBeanException, RuntimeOperationsException, IllegalArgumentException
{
   if (listener == null) throw new RuntimeOperationsException(new IllegalArgumentException(LocalizedStrings.MX4JModelMBean_LISTENER_CANNOT_BE_NULL.toLocalizedString()));
   AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
   if (attributeName != null)
   {
      filter.enableAttribute(attributeName);
   }
   else
   {
      MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
      for (int i = 0; i < ai.length; i++)
      {
         Descriptor d = ((ModelMBeanAttributeInfo)ai[i]).getDescriptor();
         filter.enableAttribute((String)d.getFieldValue("name"));
      }
   }

   getAttributeChangeBroadcaster().addNotificationListener(listener, filter, handback);

   Logger logger = getLogger();
   if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Listener " + listener + " for attribute " + attributeName + " added successfully, handback is " + handback);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号