public interface ModelMBeanNotificationBroadcaster extends NotificationBroadcaster
java资源希望能够实例化ModelMBean MBeanServer creatembean方法的使用。资源建立了ModelMBeanInfo(描述符)为ModelMBean实例。属性和操作通过ModelMBean ModelMBeanInfo暴露可从MBean,连接器/适配器像其他MBeans。通过ModelMBeanInfo描述符,在托管的应用价值和方法可以被定义和映射到的ModelMBean属性和操作。这个映射可以定义在XML格式的文件或动态发展过程中,以编程方式在运行时。
这是每个ModelMBean MBeanServer实例化成为可控的:它的属性和操作成为远程访问连接,通过MBeanServer连接器/适配器。一个java对象不能注册MBeanServer除非是JMX兼容MBean。通过实例化一个ModelMBean,资源保证MBean是有效的。
mbeanexception和runtimeoperationsexception必须扔在每个公共方法。这使得包装从分布式通信异常(RMI、EJB、等)。这些异常没有被抛出的实现除了在规格和Javadoc描述的场景。
Modifier and Type | Method and Description |
---|---|
void |
addAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback)
寄存器实现了notificationlistener接口作为一个侦听器的对象。
|
void |
removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName)
删除一个attributechangenotifications从听众。
|
void |
sendAttributeChangeNotification(Attribute oldValue, Attribute newValue)
发送一个attributechangenotification包含旧的价值,在对注册attributechangenotification ModelMBean听众属性的新值。
|
void |
sendAttributeChangeNotification(AttributeChangeNotification notification)
发送一个attributechangenotification被传递到听众对注册attributechangenotification ModelMBean。
|
void |
sendNotification(Notification ntfyObj)
发送通知,传递给注册通知听众在ModelMBean作为jmx.modelmbean.generic通知。
|
void |
sendNotification(String ntfyText)
发送通知包含文本字符串,通过对注册通知听众在ModelMBean。
|
addNotificationListener, getNotificationInfo, removeNotificationListener
void sendNotification(Notification ntfyObj) throws MBeanException, RuntimeOperationsException
ntfyObj
的通知是通过对监听对象的handlenotification法。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包IllegalArgumentException:通过参数的通知对象是无效的。
void sendNotification(String ntfyText) throws MBeanException, RuntimeOperationsException
ntfyText
-这是在通知的侦听器对象的handlenotification法通过文本。构建的通知将:键入“JMX。ModelMBean。通用的“源本ModelMBean实例序列1
MBeanException
套分布式通信异常。
RuntimeOperationsException
包IllegalArgumentException:通知文本传入的字符串参数为空。
void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException, RuntimeOperationsException
notification
的通知是通过对监听对象的handlenotification法。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包IllegalArgumentException:通过参数的attributechangenotification对象为空。
void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException, RuntimeOperationsException
oldValue
-属性的原始值
newValue
-属性的当前值
构建attributechangenotification将:型“JMX。属性。”源此ModelMBean实例序列1getname()属性属性的旧值。AttributeType属性的旧值的类attributeoldvalue getvalue()属性的旧值。attributenewvalue getvalue()价值。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包IllegalArgumentException:属性对象传递参数为空或两属性对象的名称的参数是不一样的。
void addAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws MBeanException, RuntimeOperationsException, IllegalArgumentException
listener
-监听器对象将处理由注册MBean发出通知。
attributeName
-为ModelMBean属性名称接收更改通知。如果为空,那么所有的属性的变化会引起attributechangenotification签发。
handback
的语境中被发送到通知的侦听器的通知时发出的。
IllegalArgumentException
-听者不能为空。
MBeanException
套分布式通信异常。
RuntimeOperationsException
-包装传入参数的属性名称不存在时。
removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String)
void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName) throws MBeanException, RuntimeOperationsException, ListenerNotFoundException
listener
听众的名字是处理由注册MBean发出通知。此方法将删除与此侦听器相关的所有信息。
attributeName
-属性,听众不再愿意接受attributechangenotifications。如果为空,听者将删除所有attributechangenotifications。
ListenerNotFoundException
-听者不在MBean注册或空。
MBeanException
套分布式通信异常。
RuntimeOperationsException
包IllegalArgumentException如果inattributename参数不对应的属性名称。
addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.