A converter between Java types and the limited set of classes defined by Open MBeans.
A Java type is an instance of java.lang.reflect.Type. For our purposes, it is either a Class, such as String.class or int.class; or a ParameterizedType, such as List
Each Type is associated with an OpenConverter. The OpenConverter defines an OpenType corresponding to the Type, plus a Java class corresponding to the OpenType. For example:
Type Open class OpenType ---- ---------- -------- Integer Integer SimpleType.INTEGER int int SimpleType.INTEGER Integer[] Integer[] ArrayType(1, SimpleType.INTEGER) int[] Integer[] ArrayType(SimpleType.INTEGER, true) String[][] String[][] ArrayType(2, SimpleType.STRING) ListString[] ArrayType(1, SimpleType.STRING) ThreadState (an Enum) String SimpleType.STRING Map TabularData TabularType( CompositeType( {"key", SimpleType.INTEGER}, {"value", ArrayType(1, SimpleType.STRING)}), indexNames={"key"})
Apart from simple types, arrays, and collections, Java types are converted through introspection into CompositeType. The Java type must have at least one getter (method such as "int getSize()" or "boolean isBig()"), and we must be able to deduce how to reconstruct an instance of the Java class from the values of the getters using one of various heuristics.
@since 1.6
|
|
|
|