Package org.glassfish.admin.amx.util.jmx
Class OpenMBeanUtil
- java.lang.Object
-
- org.glassfish.admin.amx.util.jmx.OpenMBeanUtil
-
public final class OpenMBeanUtil extends Object
Utilities dealing with OpenMBeans
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Serializable>
compositeDataToMap(CompositeData data)
Convert a CompositeData to a Map.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.static OpenType
getOpenType(Object o)
Get the OpenType of an Object, which must conform to OpenType requirements.static SimpleType
getSimpleType(Class<?> c)
Get the SimpleType for a class which can be so-represented.static OpenType
getStackTraceElementOpenType()
Get a CompositeType describing a CompositeData which has no elements.static OpenType
getThrowableOpenType(Throwable t)
Get a CompositeType describing a CompositeData which has no elements.static CompositeData
mapToCompositeData(String typeName, String description, Map<String,Object> map)
Create a CompositeData from a Map.static CompositeType
mapToCompositeType(String typeName, String description, Map<String,?> map, CompositeTypeFromNameCallback callback)
Create a CompositeType from a Map.static ArrayType
newArrayType(int numItems, OpenType type)
Exists to avoid warnings from multiple call sites.
-
-
-
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
-
getOpenType
public static OpenType getOpenType(Object o) throws InvalidOpenTypeException, OpenDataException
Get the OpenType of an Object, which must conform to OpenType requirements.
-
convertTypes
public static Map<String,Serializable> convertTypes(Map<String,Serializable> orig)
Convert certain types and return a new Map:- Collection converts to an array
-
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 useddescription
- the arbitrary description of the OpenType to be usedmap
- 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 useddescription
- the arbitrary description of the OpenType to be usedmap
- a Map keyed by String, whose values may not be null- Throws:
OpenDataException
-
compositeDataToMap
public static Map<String,Serializable> compositeDataToMap(CompositeData data)
Convert a CompositeData to a Map.
-
getStackTraceElementOpenType
public static OpenType getStackTraceElementOpenType() throws OpenDataException
Get a CompositeType describing a CompositeData which has no elements.- Throws:
OpenDataException
-
getThrowableOpenType
public static OpenType getThrowableOpenType(Throwable t) throws OpenDataException
Get a CompositeType describing a CompositeData which has no elements.- Throws:
OpenDataException
-
-