Methods Summary |
---|
public java.lang.String | getAttribute()
return attribute;
|
public java.lang.String | getInfo()Return descriptive information about this implementation and the
corresponding version number, in the format
<description>/<version> .
return (info);
|
protected java.lang.String | getMBeanAttributeType(javax.management.MBeanServerConnection jmxServerConnection, java.lang.String name, java.lang.String attribute)Get MBean Attriute from Mbean Server
ObjectName oname = new ObjectName(name);
String mattrType = null;
MBeanInfo minfo = jmxServerConnection.getMBeanInfo(oname);
MBeanAttributeInfo attrs[] = minfo.getAttributes();
if (attrs != null) {
for (int i = 0; mattrType == null && i < attrs.length; i++) {
if (attribute.equals(attrs[i].getName()))
mattrType = attrs[i].getType();
}
}
return mattrType;
|
public java.lang.String | getType()
return type;
|
public java.lang.String | getValue()
return value;
|
public boolean | isConvert()
return convert;
|
public java.lang.String | jmxExecute(javax.management.MBeanServerConnection jmxServerConnection)Execute the specified command, based on the configured properties. The
input stream will be closed upon completion of this task, whether it was
executed successfully or not.
if (getName() == null) {
throw new BuildException("Must specify a 'name'");
}
if ((attribute == null || value == null)) {
throw new BuildException(
"Must specify a 'attribute' and 'value' for set");
}
return jmxSet(jmxServerConnection, getName());
|
protected java.lang.String | jmxSet(javax.management.MBeanServerConnection jmxServerConnection, java.lang.String name)
Object realValue;
if (type != null) {
realValue = convertStringToType(value, type);
} else {
if (isConvert()) {
String mType = getMBeanAttributeType(jmxServerConnection, name,
attribute);
realValue = convertStringToType(value, mType);
} else
realValue = value;
}
jmxServerConnection.setAttribute(new ObjectName(name), new Attribute(
attribute, realValue));
return null;
|
public void | setAttribute(java.lang.String attribute)
this.attribute = attribute;
|
public void | setConvert(boolean convert)
this.convert = convert;
|
public void | setType(java.lang.String valueType)
this.type = valueType;
|
public void | setValue(java.lang.String value)
this.value = value;
|