summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e1f4ed3)
raw | patch | inline | side by side (parent: e1f4ed3)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 2 Aug 2009 15:54:37 +0000 (17:54 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 2 Aug 2009 15:54:37 +0000 (17:54 +0200) |
Also renamed a variable to fit the naming schema.
bindings/java/org/collectd/java/GenericJMXConfValue.java | patch | blob | history |
diff --git a/bindings/java/org/collectd/java/GenericJMXConfValue.java b/bindings/java/org/collectd/java/GenericJMXConfValue.java
index 0fcf31aad02c0ead7a9cad9a167580e132338572..b81ceb7dfc554ab1ed2739245514cdee18ac11ff 100644 (file)
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> ();