类 AttributeChangeNotificationFilter

java.lang.Object
javax.management.AttributeChangeNotificationFilter
所有已实现的接口:
Serializable , NotificationFilter

public class AttributeChangeNotificationFilter extends Object implements NotificationFilter
此类为 attribute change notification 实现了 NotificationFilter 接口。过滤是对观察到的属性的名称执行的。

它管理启用的属性名称列表。一种方法允许用户根据需要启用/禁用尽可能多的属性名称。

自从:
1.5
参见:
  • 构造方法详细信息

    • AttributeChangeNotificationFilter

      public AttributeChangeNotificationFilter()
      构造一个 AttributeChangeNotificationFilter
  • 方法详情

    • isNotificationEnabled

      public boolean isNotificationEnabled(Notification  notification)
      在向监听发送指定通知之前调用。
      此过滤器将指定属性更改通知的属性名称与每个启用的属性名称进行比较。如果属性名称等于启用的属性名称之一,则必须将通知发送到监听器并且此方法返回 true
      指定者:
      isNotificationEnabled 在接口 NotificationFilter
      参数:
      notification - 要发送的属性更改通知。
      返回:
      true 如果必须将通知发送给监听器,false 否则。
    • enableAttribute

      public void enableAttribute(String  name) throws IllegalArgumentException
      允许将所有属性名称等于指定名称的属性更改通知发送给监听。
      如果指定的名称已经在启用的属性名称列表中,则此方法无效。
      参数:
      name - 属性名称。
      抛出:
      IllegalArgumentException - 属性名称参数为空。
    • disableAttribute

      public void disableAttribute(String  name)
      禁止所有属性名称等于指定属性名称的属性更改通知发送给监听。
      如果指定的名称不在启用的属性名称列表中,则此方法无效。
      参数:
      name - 属性名称。
    • disableAllAttributes

      public void disableAllAttributes()
      禁用所有属性名称。
    • getEnabledAttributes

      public Vector <String > getEnabledAttributes()
      获取此过滤器的所有启用属性名称。
      返回:
      包含所有启用的属性名称的列表。