- java.lang.Object
-
- javax.management.AttributeValueExp
-
- 实现的所有接口
-
Serializable,ValueExp
public class AttributeValueExp extends Object implements ValueExp
表示用作关系约束的参数的属性。 通常使用
Query.attr获得此类的实例 。AttributeValueExp可以在需要ValueExp任何地方使用。- 从以下版本开始:
- 1.5
- 另请参见:
- Serialized Form
-
-
构造方法摘要
构造方法 构造器 描述 AttributeValueExp()已过时。使用此构造函数创建的实例不能在查询中使用。AttributeValueExp(String attr)创建一个新的AttributeValueExp表示指定的对象属性,名为attr。
-
方法摘要
所有方法 实例方法 具体的方法 弃用的方法 变量和类型 方法 描述 ValueExpapply(ObjectName name)在MBean上应用AttributeValueExp。protected ObjectgetAttribute(ObjectName name)返回指定MBean中给定属性的值。StringgetAttributeName()返回属性名称的字符串表示形式。voidsetMBeanServer(MBeanServer s)已过时。这种方法没有效果。StringtoString()返回表示其值的字符串。
-
-
-
构造方法详细信息
-
AttributeValueExp
@Deprecated public AttributeValueExp()
Deprecated.An instance created with this constructor cannot be used in a query.具有null属性的AttributeValueExp。
-
-
方法详细信息
-
getAttributeName
public String getAttributeName()
返回属性名称的字符串表示形式。- 结果
- 属性名称。
-
apply
public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException
在MBean上应用
AttributeValueExp。 此方法调用getAttribute(name)并将结果包装为ValueExp。 返回的值getAttribute必须是Number,String,或Boolean; 否则此方法抛出BadAttributeValueExpException,这将导致此name的包含查询为false。- Specified by:
-
apply在界面ValueExp - 参数
-
name- 将应用AttributeValueExp的MBean的名称。 - 结果
-
ValueExp。 - 异常
-
BadStringOperationException- 将无效的字符串操作传递给构造查询的方法时 -
BadBinaryOpValueExpException- 将无效表达式传递给构造查询的方法时 -
BadAttributeValueExpException- 将无效的MBean特性传递给查询构造方法时 -
InvalidApplicationException- 尝试无效申请时
-
setMBeanServer
@Deprecated public void setMBeanServer(MBeanServer s)
Deprecated.This method has no effect. The MBean Server used to obtain an attribute value isQueryEval.getMBeanServer().设置要在其上执行查询的MBean服务器。- Specified by:
-
setMBeanServer接口ValueExp - 参数
-
s- 要在其上执行查询的MBean服务器。
-
getAttribute
protected Object getAttribute(ObjectName name)
返回指定MBean中给定属性的值。 如果尝试访问该属性会生成异常,则返回null。
使用的MBean Server是由
QueryEval.getMBeanServer()返回的。- 参数
-
name- 要返回其属性的MBean的名称。 - 结果
- 属性的值,如果无法获取,则返回null。
-
-