Top Description Fields Constructors Methods
javax.management

public Class AttributeValueExp

extends Object
implements ValueExp
Class Inheritance
All Implemented Interfaces
javax.management.ValueExp, java.io.Serializable
Known Direct Subclasses
javax.management.ClassAttributeValueExp, javax.management.QualifiedAttributeValueExp
Imports
com.sun.jmx.mbeanserver.Introspector, java.io.IOException, .ObjectInputStream

Represents attributes used as arguments to relational constraints. Instances of this class are usually obtained using Query.attr.

An AttributeValueExp may be used anywhere a ValueExp is required.

Since
1.5

Field Summary

Modifier and TypeField and Description
private String
private static final long

Constructor Summary

AccessConstructor and Description
public
AttributeValueExp()
Deprecated An instance created with this constructor cannot be used in a query.

An AttributeValueExp with a null attribute.

public
AttributeValueExp(String
the name of the attribute whose value is the value of this ValueExp.
attr
)

Creates a new AttributeValueExp representing the specified object attribute, named attr.

Method Summary

Modifier and TypeMethod and Description
public ValueExp

Returns:

The ValueExp.
apply
(ObjectName
The name of the MBean on which the AttributeValueExp will be applied.
name
)

Implements javax.management.ValueExp.apply.

Applies the AttributeValueExp on an MBean.

protected Object

Returns:

the value of the attribute, or null if it could not be obtained.
getAttribute
(ObjectName
the name of the MBean whose attribute is to be returned.
name
)

Return the value of the given attribute in the named MBean.

public String

Returns:

the attribute name.
getAttributeName
()

Returns a string representation of the name of the attribute.

public void
setMBeanServer(MBeanServer
The MBean server on which the query is to be performed.
s
)

Implements javax.management.ValueExp.setMBeanServer.

Deprecated This method has no effect. The MBean Server used to obtain an attribute value is QueryEval#getMBeanServer().

Sets the MBean server on which the query is to be performed.

public String
toString()

Overrides java.lang.Object.toString.

Returns the string representing its value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attrback to summary
private String attr
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

AttributeValueExpback to summary
public AttributeValueExp()

Deprecated

An instance created with this constructor cannot be used in a query.

An AttributeValueExp with a null attribute.

Annotations
@Deprecated
AttributeValueExpback to summary
public AttributeValueExp(String attr)

Creates a new AttributeValueExp representing the specified object attribute, named attr.

Parameters
attr:String

the name of the attribute whose value is the value of this ValueExp.

Method Detail

applyback to summary
public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException, BadAttributeValueExpException, InvalidApplicationException

Implements javax.management.ValueExp.apply.

Applies the AttributeValueExp on an MBean. This method calls getAttribute(name) and wraps the result as a ValueExp. The value returned by getAttribute must be a Number, String, or Boolean; otherwise this method throws a BadAttributeValueExpException, which will cause the containing query to be false for this name.

Parameters
name:ObjectName

The name of the MBean on which the AttributeValueExp will be applied.

Returns:ValueExp

The ValueExp.

Annotations
@Override
Exceptions
BadStringOperationException:
when an invalid string operation is passed to a method for constructing a query
BadBinaryOpValueExpException:
when an invalid expression is passed to a method for constructing a query
BadAttributeValueExpException:
when an invalid MBean attribute is passed to a query constructing method
InvalidApplicationException:
when an invalid apply is attempted
getAttributeback to summary
protected Object getAttribute(ObjectName name)

Return the value of the given attribute in the named MBean. If the attempt to access the attribute generates an exception, return null.

The MBean Server used is the one returned by QueryEval#getMBeanServer().

Parameters
name:ObjectName

the name of the MBean whose attribute is to be returned.

Returns:Object

the value of the attribute, or null if it could not be obtained.

getAttributeNameback to summary
public String getAttributeName()

Returns a string representation of the name of the attribute.

Returns:String

the attribute name.

setMBeanServerback to summary
public void setMBeanServer(MBeanServer s)

Implements javax.management.ValueExp.setMBeanServer.

Deprecated

This method has no effect. The MBean Server used to obtain an attribute value is QueryEval#getMBeanServer().

Sets the MBean server on which the query is to be performed.

Parameters
s:MBeanServer

The MBean server on which the query is to be performed.

Annotations
@Deprecated
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the string representing its value.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override