import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
+import javax.management.openmbean.OpenType;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.InvalidKeyException;
*/
class GenericJMXConfValue
{
- private String ds_name;
+ private String _ds_name;
private DataSet _ds;
private List<String> _attributes;
private String _instance_prefix;
else
{
if (value instanceof CompositeData)
- return (queryAttributeRecursive ((CompositeData) value, attrNameList));
+ return (queryAttributeRecursive((CompositeData) value, attrNameList));
+ else if (value instanceof OpenType)
+ {
+ OpenType ot = (OpenType) value;
+ Collectd.logNotice ("GenericJMXConfValue: Handling of OpenType \""
+ + ot.getTypeName () + "\" is not yet implemented.");
+ return (null);
+ }
else
+ {
+ Collectd.logError ("GenericJMXConfValue: Received object of "
+ + "unknown class.");
return (null);
+ }
}
} /* }}} Object queryAttribute */
List<OConfigItem> children;
Iterator<OConfigItem> iter;
- this.ds_name = null;
+ this._ds_name = null;
this._ds = null;
this._attributes = new ArrayList<String> ();
this._instance_prefix = null;
{
String tmp = getConfigString (child);
if (tmp != null)
- this.ds_name = tmp;
+ this._ds_name = tmp;
}
else if (child.getKey ().equalsIgnoreCase ("Table"))
{
+ child.getKey ()));
}
- if (this.ds_name == null)
+ if (this._ds_name == null)
throw (new IllegalArgumentException ("No data set was defined."));
else if (this._attributes.size () == 0)
throw (new IllegalArgumentException ("No attribute was defined."));
if (this._ds == null)
{
- this._ds = Collectd.getDS (this.ds_name);
+ this._ds = Collectd.getDS (this._ds_name);
if (this._ds == null)
{
Collectd.logError ("GenericJMXConfValue: Unknown type: "
- + this.ds_name);
+ + this._ds_name);
return;
}
}
if (dsrc.size () != this._attributes.size ())
{
Collectd.logError ("GenericJMXConfValue.query: The data set "
- + ds_name + " has " + this._ds.getDataSources ().size ()
+ + this._ds_name + " has " + this._ds.getDataSources ().size ()
+ " data sources, but there were " + this._attributes.size ()
+ " attributes configured. This doesn't match!");
this._ds = null;
}
vl = new ValueList (pd);
- vl.setType (this.ds_name);
+ vl.setType (this._ds_name);
vl.setTypeInstance (this._instance_prefix);
values = new ArrayList<Object> ();