FileDocCategorySizeDatePackage
QualifiedAttributeValueExp.javaAPI DocJava SE 5 API2689Fri Aug 26 14:57:34 BST 2005javax.management

QualifiedAttributeValueExp

public class QualifiedAttributeValueExp extends AttributeValueExp
This class represents indexed attributes used as arguments to relational constraints. An QualifiedAttributeValueExp may be used anywhere a ValueExp is required.
serial
include
since
1.5

Fields Summary
private static final long
serialVersionUID
private String
className
Constructors Summary
public QualifiedAttributeValueExp()
Basic Constructor.

        

           
       
    
public QualifiedAttributeValueExp(String className, String attr)
Creates a new QualifiedAttributeValueExp representing the specified object attribute, named attr with class name className.

 
	super(attr);
	this.className = className;
    
Methods Summary
public javax.management.ValueExpapply(javax.management.ObjectName name)
Applies the QualifiedAttributeValueExp to an MBean.

param
name The name of the MBean on which the QualifiedAttributeValueExp will be applied.
return
The ValueExp.
exception
BadStringOperationException
exception
BadBinaryOpValueExpException
exception
BadAttributeValueExpException
exception
InvalidApplicationException

	try {
	    MBeanServer server = QueryEval.getMBeanServer();
	    String v = server.getObjectInstance(name).getClassName();
	    
	    if (v.equals(className)) {
		return super.apply(name);
	    }
	    throw new InvalidApplicationException("Class name is " + v +
						  ", should be " + className);
	    
	} catch (Exception e) {
	    throw new InvalidApplicationException("Qualified attribute: " + e);
	    /* Can happen if MBean disappears between the time we
	       construct the list of MBeans to query and the time we
	       evaluate the query on this MBean, or if
	       getObjectInstance throws SecurityException.  */
	}
    
public java.lang.StringgetAttrClassName()
Returns a string representation of the class name of the attribute.

 
	return className;
    
public java.lang.StringtoString()
Returns the string representing its value

 
	if (className != null) {
	    return className + "." + super.toString();
	} else {
	    return super.toString();
	}