public interface ModelMBean extends DynamicMBean, PersistentMBean, ModelMBeanNotificationBroadcaster
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 |
setManagedResource(Object mr, String mr_type)
设置这个ModelMBean管理界面执行所有的方法对该对象的实例句柄(MBeanInfo描述)。
|
void |
setModelMBeanInfo(ModelMBeanInfo inModelMBeanInfo)
初始化使用ModelMBeanInfo ModelMBean对象了。
|
getAttribute, getAttributes, getMBeanInfo, invoke, setAttribute, setAttributesload, storeaddAttributeChangeNotificationListener, removeAttributeChangeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotificationaddNotificationListener, getNotificationInfo, removeNotificationListenervoid setModelMBeanInfo(ModelMBeanInfo inModelMBeanInfo) throws MBeanException, RuntimeOperationsException
如果ModelMBean现在注册,该方法抛出一个RuntimeOperationsException包装IllegalStateException
inModelMBeanInfo - ModelMBeanInfo对象由ModelMBean使用。
MBeanException套分布式通信异常。
RuntimeOperationsException -
IllegalArgumentException如果mbeaninfo传入参数为空。IllegalStateException如果ModelMBean目前注册MBeanServer。void setManagedResource(Object mr, String mr_type) throws MBeanException, RuntimeOperationsException, InstanceNotFoundException, InvalidTargetObjectTypeException
mr对象是托管资源
mr_type -托管资源参考类型。可以是:对象引用,句柄,返回抑制,EJBHandle,RMIReference。如果无法处理mr_type MBeanServer中度过的,一个invalidtargettypeexception将抛出。
MBeanException -对象初始化了一个例外。
RuntimeOperationsException包IllegalArgumentException:托管资源类型传递参数为空。
InstanceNotFoundException非托管资源的对象不能被发现
InvalidTargetObjectTypeException -托管资源类型无法处理由ModelMBean或JMX代理。
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.