JavaTM 2 Platform
Standard Ed. 6

javax.management
类 AttributeChangeNotificationFilter

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

public class AttributeChangeNotificationFilter
extends Object
implements NotificationFilter

此类实现 attribute change notificationNotificationFilter 接口。根据所观察属性的名称进行过滤。

它管理已启用的属性名称列表。方法允许用户启用/禁用所需数量的属性名称。

从以下版本开始:
1.5
另请参见:
序列化表格

构造方法摘要
AttributeChangeNotificationFilter()
           
 
方法摘要
 void disableAllAttributes()
          禁用所有属性名称。
 void disableAttribute(String name)
          禁用所有属性更改通知,这些通知的属性名称等于要发送到侦听器的指定属性名称。
 void enableAttribute(String name)
          启用所有属性更改通知,这些通知的属性名称等于要发送到侦听器的指定名称。
 Vector<String> getEnabledAttributes()
          获得此过滤器的所有已启用属性名称。
 boolean isNotificationEnabled(Notification notification)
          向侦听器发送指定的通知之前调用。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

AttributeChangeNotificationFilter

public AttributeChangeNotificationFilter()
方法详细信息

isNotificationEnabled

public boolean isNotificationEnabled(Notification notification)
向侦听器发送指定的通知之前调用。
此过滤器将指定属性更改通知的属性名称与每个已启用属性名称进行比较。如果该属性名称等于某个已启用属性名称,则必须将该通知发送到侦听器,并且此方法返回 true

指定者:
接口 NotificationFilter 中的 isNotificationEnabled
参数:
notification - 要发送的属性更改通知。
返回:
如果必须将通知发送到侦听器,则返回 true;否则返回 false

enableAttribute

public void enableAttribute(String name)
                     throws IllegalArgumentException
启用所有属性更改通知,这些通知的属性名称等于要发送到侦听器的指定名称。
如果指定的名称已在已启用属性名称列表中,则此方法无效。

参数:
name - 属性名称。
抛出:
IllegalArgumentException - 如果属性名称的参数为 null。

disableAttribute

public void disableAttribute(String name)
禁用所有属性更改通知,这些通知的属性名称等于要发送到侦听器的指定属性名称。
如果指定的名称不在已启用属性名称列表中,则此方法无效。

参数:
name - 属性名称。

disableAllAttributes

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


getEnabledAttributes

public Vector<String> getEnabledAttributes()
获得此过滤器的所有已启用属性名称。

返回:
包含所有已启用属性名称的列表。

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策