Class OpenMBeanUtil


  • public final class OpenMBeanUtil
    extends Object
    Utilities dealing with OpenMBeans
    • Method Detail

      • getSimpleType

        public static SimpleType getSimpleType​(Class<?> c)
        Get the SimpleType for a class which can be so-represented.
      • newArrayType

        public static ArrayType newArrayType​(int numItems,
                                             OpenType type)
                                      throws OpenDataException
        Exists to avoid warnings from multiple call sites. JMX in JDK 1.5 does not have generic types for JMX, but does in JDK 1.6. This makes it impossible to use generics so long as we're compiling with 1.5. It also means we'll get warnings in JDK 1.6!
        Throws:
        OpenDataException
      • convertTypes

        public static Map<String,​Serializable> convertTypes​(Map<String,​Serializable> orig)
        Convert certain types and return a new Map:
        • Collection converts to an array
        Nulls are not eliminated.
      • mapToCompositeType

        public static CompositeType mapToCompositeType​(String typeName,
                                                       String description,
                                                       Map<String,​?> map,
                                                       CompositeTypeFromNameCallback callback)
                                                throws OpenDataException
        Create a CompositeType from a Map. Each key in the map must be a String, and each value must be a type consistent with OpenTypes.
        Parameters:
        typeName - the arbitrary name of the OpenType to be used
        description - the arbitrary description of the OpenType to be used
        map - a Map keyed by String, whose values may not be null
        Throws:
        OpenDataException
      • mapToCompositeData

        public static CompositeData mapToCompositeData​(String typeName,
                                                       String description,
                                                       Map<String,​Object> map)
                                                throws OpenDataException
        Create a CompositeData from a Map. Each key in the map must be a String, and each value must be a type consistent with OpenTypes.
        Parameters:
        typeName - the arbitrary name of the OpenType to be used
        description - the arbitrary description of the OpenType to be used
        map - a Map keyed by String, whose values may not be null
        Throws:
        OpenDataException