Methods Summary |
---|
public javax.management.ValueExp | apply(javax.management.ObjectName name)Applies the AttributeValueExp on an MBean.
Object result = getAttribute(name);
if (result instanceof Number) {
return new NumericValueExp((Number)result);
} else if (result instanceof String) {
return new StringValueExp((String)result);
} else if (result instanceof Boolean) {
return new BooleanValueExp((Boolean)result);
} else {
throw new BadAttributeValueExpException(result);
}
|
protected java.lang.Object | getAttribute(javax.management.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.
try {
// Get the value from the MBeanServer
MBeanServer server = QueryEval.getMBeanServer();
return server.getAttribute(name, attr);
} catch (Exception re) {
return null;
}
|
public java.lang.String | getAttributeName()Returns a string representation of the name of the attribute.
return attr;
|
public void | setMBeanServer(javax.management.MBeanServer s)Sets the MBean server on which the query is to be performed.
|
public java.lang.String | toString()Returns the string representing its value.
return attr;
|