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<String> or
Map<Integer, String[]>.
On J2SE 1.4 and earlier, it can only be a Class.
Each Type is associated with an DefaultMXBeanMappingFactory. The DefaultMXBeanMappingFactory 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)
List<String> String[] ArrayType(1, SimpleType.STRING)
ThreadState (an Enum) String SimpleType.STRING
Map<Integer, String[]> 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.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private abstract static class | DefaultMXBeanMappingFactory.
Converts from a CompositeData to an instance of the targetClass. |
| private static class | DefaultMXBeanMappingFactory.
This builder never actually returns success. |
| private static class | DefaultMXBeanMappingFactory.
Builder for when the target class has a constructor that is
annotated with @ConstructorParameters
or |
| private static class | DefaultMXBeanMappingFactory.
Builder for when the target class has a method "public static from(CompositeData)". |
| private static class | DefaultMXBeanMappingFactory.
Builder for when the target class is an interface and contains no methods other than getters. |
| private static class | DefaultMXBeanMappingFactory.
Builder for when the target class has a setter for every getter. |
| private static class | |
| private static class | |
| private static class | |
| private static class | |
| private static class | |
| pack-priv abstract static class | |
| private static class | DefaultMXBeanMappingFactory.
Builder for when the target class is a record |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | |
| private static final String[] | |
| private static final String[] | |
| private static final DefaultMXBeanMappingFactory. | |
| private static final List | permanentMappings
Following List simply serves to keep a reference to predefined MXBeanMappings so they don't get garbage collected. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static String | |
| public static String | Returns: The decapitalized version of the string.The string to be decapitalized. name)Utility method to take a string and convert it to normal Java variable name capitalization. |
| private static synchronized MXBeanMapping | |
| pack-priv static InvalidObjectException | |
| pack-priv static InvalidObjectException | |
| pack-priv static boolean | |
| private MXBeanMapping | |
| private MXBeanMapping | |
| private static <T extends Enum | |
| private MXBeanMapping | |
| private static MXBeanMapping | |
| private MXBeanMapping | |
| private MXBeanMapping | makeTabularMapping(Type objType, boolean sortedMap, Type keyType, Type valueType, MXBeanMappingFactory factory)
|
| public synchronized MXBeanMapping | mappingForType(Type objType, MXBeanMappingFactory factory)
Implements abstract com. Get the converter for the given Java type, creating it if necessary. |
| pack-priv static void | |
| pack-priv static OpenDataException | |
| pack-priv static OpenDataException | |
| public static String | |
| private static synchronized void | |
| private static synchronized void |