JavaTM 2 Platform
Standard Ed. 6

javax.management
类 MBeanServerDelegate

java.lang.Object
  继承者 javax.management.MBeanServerDelegate
所有已实现的接口:
MBeanServerDelegateMBean, NotificationBroadcaster, NotificationEmitter

public class MBeanServerDelegate
extends Object
implements MBeanServerDelegateMBean, NotificationEmitter

从管理的角度表示 MBean 服务器。在 MBean 服务器中注册/注销 MBean 时,MBeanServerDelegate MBean 发出 MBeanServerNotifications。

从以下版本开始:
1.5

字段摘要
static ObjectName DELEGATE_NAME
          定义 MBeanServerDelegate 的默认 ObjectName。
 
构造方法摘要
MBeanServerDelegate()
          创建一个 MBeanServerDelegate 对象。
 
方法摘要
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          在此 MBean 中添加一个侦听器。
 String getImplementationName()
          返回 JMX 实现的名称(此产品的名称)。
 String getImplementationVendor()
          返回 JMX 实现供应商(此产品的供应商)。
 String getImplementationVersion()
          返回 JMX 实现的版本(此产品的版本)。
 String getMBeanServerId()
          返回 MBean 服务器代理标识。
 MBeanNotificationInfo[] getNotificationInfo()
          返回一个数组,指示此 MBean 可能发送的每个通知的 Java 类名和通知类型。
 String getSpecificationName()
          返回此产品实现的 JMX 规范的全名。
 String getSpecificationVendor()
          返回此产品实现的 JMX 规范的供应商。
 String getSpecificationVersion()
          返回此产品实现的 JMX 规范的版本。
 void removeNotificationListener(NotificationListener listener)
          从此 MBean 移除一个侦听器。
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          从此 MBean 移除一个侦听器。
 void sendNotification(Notification notification)
          允许 MBean 服务器发送通知。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

DELEGATE_NAME

public static final ObjectName DELEGATE_NAME
定义 MBeanServerDelegate 的默认 ObjectName。

从以下版本开始:
1.6
构造方法详细信息

MBeanServerDelegate

public MBeanServerDelegate()
创建一个 MBeanServerDelegate 对象。

方法详细信息

getMBeanServerId

public String getMBeanServerId()
返回 MBean 服务器代理标识。

指定者:
接口 MBeanServerDelegateMBean 中的 getMBeanServerId
返回:
标识。

getSpecificationName

public String getSpecificationName()
返回此产品实现的 JMX 规范的全名。

指定者:
接口 MBeanServerDelegateMBean 中的 getSpecificationName
返回:
规范的名称。

getSpecificationVersion

public String getSpecificationVersion()
返回此产品实现的 JMX 规范的版本。

指定者:
接口 MBeanServerDelegateMBean 中的 getSpecificationVersion
返回:
规范的版本。

getSpecificationVendor

public String getSpecificationVendor()
返回此产品实现的 JMX 规范的供应商。

指定者:
接口 MBeanServerDelegateMBean 中的 getSpecificationVendor
返回:
规范的供应商。

getImplementationName

public String getImplementationName()
返回 JMX 实现的名称(此产品的名称)。

指定者:
接口 MBeanServerDelegateMBean 中的 getImplementationName
返回:
实现的名称。

getImplementationVersion

public String getImplementationVersion()
返回 JMX 实现的版本(此产品的版本)。

指定者:
接口 MBeanServerDelegateMBean 中的 getImplementationVersion
返回:
实现版本。

getImplementationVendor

public String getImplementationVendor()
返回 JMX 实现供应商(此产品的供应商)。

指定者:
接口 MBeanServerDelegateMBean 中的 getImplementationVendor
返回:
实现供应商。

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
从接口 NotificationBroadcaster 复制的描述

返回一个数组,指示此 MBean 可能发送的每个通知的 Java 类名和通知类型。

MBean 发送此数组中未描述的通知是合法的。但是,某些 MBean 服务器的客户端要想正常运行,可能要依赖完整的数组。

指定者:
接口 NotificationBroadcaster 中的 getNotificationInfo
返回:
可能的通知数组。

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws IllegalArgumentException
从接口 NotificationBroadcaster 复制的描述
在此 MBean 中添加一个侦听器。

指定者:
接口 NotificationBroadcaster 中的 addNotificationListener
参数:
listener - 将处理广播者发出的通知的侦听器对象。
filter - 过滤器对象。如果 filter 为 null,则处理通知前不执行过滤。
handback - 发出通知时要发送回侦听器的不透明对象。Notification 广播者对象不能使用此对象。应该将通知不作更改地重新发送到侦听器。
抛出:
IllegalArgumentException - 如果 Listener 参数为 null。
另请参见:
NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener)

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
从接口 NotificationEmitter 复制的描述

从此 MBean 移除一个侦听器。该 MBean 必须有一个与给定 listenerfilterhandback 参数完全匹配的侦听器。如果有多个此类侦听器,则只移除一个侦听器。

当且仅当在要移除的侦听器中 filterhandback 参数为 null 时,这两个参数才可以为 null。

指定者:
接口 NotificationEmitter 中的 removeNotificationListener
参数:
listener - 以前添加到此 MBean 中的侦听器。
filter - 添加侦听器时指定的过滤器。
handback - 添加侦听器时指定的回送。
抛出:
ListenerNotFoundException - 如果没有在该 MBean 中注册侦听器,或者没有用给定的过滤器和回送注册它。

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
从接口 NotificationBroadcaster 复制的描述
从此 MBean 移除一个侦听器。如果已向不同的 handback 对象或通知过滤器注册了该侦听器,则移除与该侦听器有关的所有项。

指定者:
接口 NotificationBroadcaster 中的 removeNotificationListener
参数:
listener - 以前添加到此 MBean 中的侦听器。
抛出:
ListenerNotFoundException - 如果没有在 MBean 中注册该侦听器。
另请参见:
NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object), NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)

sendNotification

public void sendNotification(Notification notification)
允许 MBean 服务器发送通知。如果传递的 notification 的序列号小于或等于 0,则用该委托自己的序列号替换它。

参数:
notification - 要发送的通知。

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only