Management (Java EE 5)

Java EE API


javax.management.j2ee Interface Management

All Superinterfaces:
EJBObject, Remote

public interface Management
extends EJBObject

Implements: EJBObject

Management 接口提供导航和操作管理对象的 API。J2EE Management EJB 组件 (MEJB) 必须将此接口作为其远程接口实现。
英文文档:

The Management interface provides the APIs to navigate and manipulate managed objects. The J2EE Management EJB component (MEJB) must implement this as its remote interface.

Author:
Hans Hrasna

Method Summary
 Object
 AttributeList
 String
 ListenerRegistration
 Integer
 MBeanInfo
 Object
 boolean
 Set
 void
 AttributeList
 
Methods inherited from interface javax.ejb.EJBObject
 

Method Detail

public java.util.Set<E> queryNames(javax.management.ObjectName name, javax.management.QueryExp query) throws java.rmi.RemoteException
获取 MEJB 所控制的管理对象的名称。此方法允许获取以下任意内容:所有管理对象的名称,与 ObjectName 匹配的模式所指定的管理对象集合的名称,以及一个特定的管理对象名称(等效于测试管理对象是否被注册)。当对象名称为 null 或未指定域和键属性时,选择所有对象。它返回所选择的管理对象的 J2EEObjectNames 集合。
name 对象名称模式,标识要获取的管理对象。如果为 null 或未指定域和键属性,则获取所有已注册的管理对象。
return 一个集合,包含所选择管理对象的 ObjectName。如果没有满足该查询的管理对象,则返回一个空集合。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

queryNames

Set queryNames(ObjectName name,
               QueryExp query)
               throws RemoteException
Gets the names of managed objects controlled by the MEJB. This method enables any of the following to be obtained: The names of all managed objects, the names of a set of managed objects specified by pattern matching on the ObjectName, a specific managed object name (equivalent to testing whether a managed object is registered). When the object name is null or no domain and key properties are specified, all objects are selected. It returns the set of J2EEObjectNames for the managed objects selected.

Parameters:
name - The object name pattern identifying the managed objects to be retrieved. If null or no domain and key properties are specified, all the managed objects registered will be retrieved.
Returns:
A set containing the ObjectNames for the managed objects selected. If no managed object satisfies the query, an empty set is returned.
Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public boolean isRegistered(javax.management.ObjectName name) throws java.rmi.RemoteException
检查某个管理对象(通过其对象名称标识)是否已向 MEJB 注册。
name 要检查的管理对象的对象名称。
return 如果已在 MEJB 中注册了该管理对象,则返回 true;否则返回 false。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

isRegistered

boolean isRegistered(ObjectName name)
                     throws RemoteException
Checks whether a managed object, identified by its object name, is already registered with the MEJB.

Parameters:
name - The object name of the managed object to be checked.
Returns:
True if the managed object is already registered in the MEJB, false otherwise.
Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public Integer getMBeanCount() throws java.rmi.RemoteException
返回已在 MEJB 中注册的管理对象数。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

getMBeanCount

Integer getMBeanCount()
                      throws RemoteException
Returns the number of managed objects registered in the MEJB.

Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name) throws javax.management.IntrospectionException, javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
此方法发现管理对象为管理而公开的属性和操作。
name 要分析的管理对象的名称
return 一个 MBeanInfo 实例,允许获取此管理对象的所有属性和操作。
Throwsjavax.management.IntrospectionException: 如果在 introspection 期间出现异常。
Throwsjavax.management.InstanceNotFoundException: 如果未找到指定的管理对象。
Throwsjavax.management.ReflectionException: 试图在管理对象上执行反射时发生异常
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

getMBeanInfo

MBeanInfo getMBeanInfo(ObjectName name)
                       throws IntrospectionException,
                              InstanceNotFoundException,
                              ReflectionException,
                              RemoteException
This method discovers the attributes and operations that a managed object exposes for management.

Parameters:
name - The name of the managed object to analyze
Returns:
An instance of MBeanInfo allowing the retrieval of all attributes and operations of this managed object.
Throws:
IntrospectionException - An exception occurs during introspection.
InstanceNotFoundException - The managed object specified is not found.
ReflectionException - An exception occurred when trying to perform reflection on a managed object
RemoteException - A communication exception occurred during the execution of a remote method call

public Object getAttribute(javax.management.ObjectName name, String attribute) throws javax.management.MBeanException, javax.management.AttributeNotFoundException, javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
获取指定管理对象的特定属性值。管理对象通过其对象名称标识。
name 管理对象的对象名称,要通过该对象名称获取管理对象的属性。
attribute 指定要获取的属性名称的 String。
return 检索到的属性值。
Throwsjavax.management.AttributeNotFoundException: 如果指定的属性在管理对象中无法访问。
Throwsjavax.management.MBeanException: 包装管理对象的获取方法所抛出的异常。
Throwsjavax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throwsjavax.management.ReflectionException: 试图调用 Dynamic MBean 的 getAttribute 方法时发生异常
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

getAttribute

Object getAttribute(ObjectName name,
                    String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException,
                           RemoteException
Gets the value of a specific attribute of a named managed object. The managed object is identified by its object name.

Parameters:
name - The object name of the managed object from which the attribute is to be retrieved.
attribute - A String specifying the name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute.
Throws:
AttributeNotFoundException - The attribute specified is not accessible in the managed object.
MBeanException - Wraps an exception thrown by the managed object's getter.
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
ReflectionException - An exception occurred when trying to invoke the getAttribute method of a Dynamic MBean
RemoteException - A communication exception occurred during the execution of a remote method call

public javax.management.AttributeList getAttributes(javax.management.ObjectName name, String[] attributes) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
获取指定管理对象的多个属性值。管理对象通过其对象名称标识。
name 管理对象的对象名称,通过该对象名称获取管理对象的属性。
attributes 要检索的属性列表。
return 检索到的属性列表。
Throwsjavax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throwsjavax.management.ReflectionException: 试图调用 Dynamic MBean 的 getAttributes 方法时发生异常。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

getAttributes

AttributeList getAttributes(ObjectName name,
                            String[] attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   RemoteException
Enables the values of several attributes of a named managed object. The managed object is identified by its object name.

Parameters:
name - The object name of the managed object from which the attributes are retrieved.
attributes - A list of the attributes to be retrieved.
Returns:
The list of the retrieved attributes.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
ReflectionException - An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean.
RemoteException - A communication exception occurred during the execution of a remote method call

public void setAttribute(javax.management.ObjectName name, javax.management.Attribute attribute) throws javax.management.InstanceNotFoundException, javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException, java.rmi.RemoteException
设置指定管理对象的特定属性值。管理对象通过其对象名称标识。
name 要设置其属性的管理对象的名称。
attribute 要设置的属性的标识及其要设置成的值。
Throwsjavax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throwsjavax.management.AttributeNotFoundException: 如果指定的属性在管理对象中无法访问。
Throwsjavax.management.InvalidAttributeValueException: 如果为该属性指定的值无效。
Throwsjavax.management.MBeanException: 包装管理对象的设置方法所抛出的异常。
Throwsjavax.management.ReflectionException: 试图调用 Dynamic MBean 的 setAttribute 方法时发生异常。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

setAttribute

void setAttribute(ObjectName name,
                  Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException,
                         RemoteException
Sets the value of a specific attribute of a named managed object. The managed object is identified by its object name.

Parameters:
name - The name of the managed object within which the attribute is to be set.
attribute - The identification of the attribute to be set and the value it is to be set to.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
AttributeNotFoundException - The attribute specified is not accessible in the managed object.
InvalidAttributeValueException - The value specified for the attribute is not valid.
MBeanException - Wraps an exception thrown by the managed object's setter.
ReflectionException - An exception occurred when trying to invoke the setAttribute method of a Dynamic MBean.
RemoteException - A communication exception occurred during the execution of a remote method call

public javax.management.AttributeList setAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException
设置指定管理对象的多个属性值。管理对象通过其对象名称标识。
name 要设置其属性的管理对象的对象名称。
attributes 属性列表:要设置的属性的标识和这些属性要设置的值。
return 已设置的属性的列表,以及它们的新值。
Throwsjavax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throwsjavax.management.ReflectionException: 试图调用 Dynamic MBean 的 setAttributes 方法时发生异常。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

setAttributes

AttributeList setAttributes(ObjectName name,
                            AttributeList attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException,
                                   RemoteException
Sets the values of several attributes of a named managed object. The managed object is identified by its object name.

Parameters:
name - The object name of the managed object within which the attributes are to be set.
attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
Returns:
The list of attributes that were set, with their new values.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
ReflectionException - An exception occurred when trying to invoke the setAttributes method of a Dynamic MBean.
RemoteException - A communication exception occurred during the execution of a remote method call

public Object invoke(javax.management.ObjectName name, String operationName, Object[] params, String[] signature) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException, java.rmi.RemoteException
对管理对象调用某个操作。
name 管理对象的对象名称,将对该管理对象调用方法。
operationName 要调用的操作名。
params 一个数组,包含调用操作时要设置的参数
signature 包含操作签名的数组。用于加载类对象的类加载器与用于加载管理对象(要对其调用操作)的类加载器相同。
return 该操作返回的对象,表示对指定管理对象调用该操作的结果。
Throwsjavax.management.InstanceNotFoundException: 指定的管理对象未在 MEJB 中注册。
Throwsjavax.management.MBeanException: 包装对管理对象调用的方法所抛出的异常。
Throwsjavax.management.ReflectionException: 包装试图调用该方法时所抛出的 java.lang.Exception
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

invoke

Object invoke(ObjectName name,
              String operationName,
              Object[] params,
              String[] signature)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException,
                     RemoteException
Invokes an operation on a managed object.

Parameters:
name - The object name of the managed object on which the method is to be invoked.
operationName - The name of the operation to be invoked.
params - An array containing the parameters to be set when the operation is invoked
signature - An array containing the signature of the operation. The class objects will be loaded using the same class loader as the one used for loading the managed object on which the operation was invoked.
Returns:
The object returned by the operation, which represents the result of invoking the operation on the managed object specified.
Throws:
InstanceNotFoundException - The managed object specified is not registered in the MEJB.
MBeanException - Wraps an exception thrown by the managed object's invoked method.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method.
RemoteException - A communication exception occurred during the execution of a remote method call

public String getDefaultDomain() throws java.rmi.RemoteException
返回此 MEJB 的默认域名。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

getDefaultDomain

String getDefaultDomain()
                        throws RemoteException
Returns the default domain name of this MEJB.

Throws:
RemoteException - A communication exception occurred during the execution of a remote method call

public ListenerRegistration getListenerRegistry() throws java.rmi.RemoteException
返回此 MEJB 的侦听器注册表实现。侦听器注册表实现的方法使客户端能在管理对象中添加和移除事件通知侦听器
return javax.management.j2ee.ListenerRegistration 的实现。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

getListenerRegistry

ListenerRegistration getListenerRegistry()
                                         throws RemoteException
Returns the listener registry implementation for this MEJB. The listener registry implements the methods that enable clints to add and remove event notification listeners managed objects

Returns:
An implementation of javax.management.j2ee.ListenerRegistration
Throws:
RemoteException - A communication exception occurred during the execution of a remote method call


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!