List of usage examples for javax.management.openmbean SimpleType isValue
public boolean isValue(Object obj)
SimpleType
instance. From source file:com.clustercontrol.jmx.factory.RunMonitorJmx.java
private Object searchTargetValue(Object value, List<Object> keys) throws Exception { if (value instanceof CompositeData) { if (keys.isEmpty()) throw new Exception("not found value according to keys."); return searchTargetValue(((CompositeData) value).get(keys.get(0).toString()), keys.subList(1, keys.size())); } else if (value instanceof TabularData) { if (keys.isEmpty()) throw new Exception("not found value according to keys."); return searchTargetValue(((TabularData) value).get((Object[]) keys.get(0)), keys.subList(1, keys.size())); } else {//from www. j a v a 2 s .co m for (SimpleType<?> t : validTypes) { if (t.isValue(value)) return value; } throw new Exception("value type id invalid. " + value.getClass()); } }