java.lang.Object
javax.management.AttributeValueExp
- 所有已实现的接口:
Serializable,ValueExp
表示用作关系约束参数的属性。此类的实例通常使用 Query.attr 获得。
AttributeValueExp 可用于任何需要 ValueExp 的地方。
- 自从:
- 1.5
- 参见:
-
构造方法总结
构造方法构造方法描述已弃用。使用此构造方法创建的实例不能在查询中使用。AttributeValueExp(String attr) 创建一个新的AttributeValueExp表示指定的对象属性,名为 attr。 -
方法总结
修饰符和类型方法描述apply(ObjectName name) 在 MBean 上应用AttributeValueExp。protected ObjectgetAttribute(ObjectName name) 返回指定 MBean 中给定属性的值。返回属性名称的字符串表示形式。void已弃用。此方法无效。toString()返回表示其值的字符串。
-
构造方法详细信息
-
AttributeValueExp
已弃用。使用此构造方法创建的实例不能在查询中使用。具有空属性的AttributeValueExp。 -
AttributeValueExp
创建一个新的AttributeValueExp表示指定的对象属性,名为 attr。- 参数:
attr- 其值为此ValueExp值的属性的名称。
-
-
方法详情
-
getAttributeName
返回属性名称的字符串表示形式。- 返回:
- 属性名称。
-
apply
public ValueExp apply(ObjectName name) throws BadStringOperationException , BadBinaryOpValueExpException , BadAttributeValueExpException , InvalidApplicationException 在 MBean 上应用
AttributeValueExp。此方法调用getAttribute(name)并将结果包装为ValueExp。getAttribute返回的值必须是Number、String或Boolean;否则此方法会抛出一个BadAttributeValueExpException,这将导致此name的包含查询为假。- 指定者:
apply在接口ValueExp中- 参数:
name- 将应用AttributeValueExp的 MBean 的名称。- 返回:
ValueExp。- 抛出:
BadStringOperationException- 当将无效的字符串操作传递给构造查询的方法时BadBinaryOpValueExpException- 当将无效表达式传递给构造查询的方法时BadAttributeValueExpException- 当将无效的 MBean 属性传递给查询构造方法时InvalidApplicationException- 尝试无效应用时
-
toString
返回表示其值的字符串。 -
setMBeanServer
已弃用。此方法无效。用于获取属性值的 MBean Server 是QueryEval.getMBeanServer()。设置要在其上执行查询的 MBean 服务。- 指定者:
setMBeanServer在接口ValueExp中- 参数:
s- 要在其上执行查询的 MBean 服务。
-
getAttribute
返回指定 MBean 中给定属性的值。如果访问该属性的尝试产生异常,则返回 null。
使用的 MBean 服务是由
QueryEval.getMBeanServer()返回的。- 参数:
name- 要返回其属性的 MBean 的名称。- 返回:
- 属性的值,如果无法获取则为 null。
-