JBossMX Parent POM 6.0.0.GA

org.jboss.mx.mxbean
Class MXBeanUtils

java.lang.Object
  extended by org.jboss.mx.mxbean.MXBeanUtils

public class MXBeanUtils
extends Object

Utils.

Version:
$Revision: 86129 $
Author:
Adrian Brock

Field Summary
static String[] MAP_INDEX_NAMES
          Map index names
static String[] MAP_ITEM_NAMES
          Map item names
static String MAP_KEY
          The map key
static String MAP_VALUE
          The map value
 
Constructor Summary
MXBeanUtils()
           
 
Method Summary
static ArrayType checkArray(Type type)
          Get the array type for a class
static ArrayType checkCollection(Type type)
          Get the collection type for a class
static ArrayType checkCollectionClass(Class clazz)
          Get the collection type for a class
static SimpleType checkEnum(Type type)
          Get the simple type for an enum
static TabularType checkMap(Type type)
          Get the map type for a class
static TabularType checkMapClass(Class<?> clazz)
          Get the map type for a class
static SimpleType checkSimpleType(Type type)
          Get the SimpleType for a class
static OpenType checkType(Type type)
          Get the for a class that is not composite
static Object construct(OpenType openType, Object value, Object context)
          Construct some open data
static Object construct(Type type, Object value, Object context)
          Construct some open data
static Object constructArrayData(OpenType openType, Object value, Object context)
          Construct an array type open data
static Object constructCompositeData(OpenType openType, Object value, Object context)
          Construct composite type open data
static Object constructSimpleData(Object value)
          Construct a simple type open data
static Object constructTabularData(OpenType openType, Object value, Object context)
          Construct a tabular type open data
static
<T> T
createCompositeDataProxy(Class<T> intf, CompositeData compositeData)
          Create a composite data proxy
static TabularType createMapType(Type keyType, Type valueType)
          Create a map type
static DynamicMBean createMXBean(Object resource, Class<?> mxbeanInterface)
          Create a new MXBean
static String getCompositeDataKey(Method method)
          Get the key for a composite data getter method
static Method getCompositeDataMethod(Class clazz, String key, boolean isBoolean)
          Get the key for a composite data getter method
static OpenType getOpenType(Type type)
          Get the OpenType for a class
static SimpleType getSimpleType(Class<?> type)
          Get the SimpleType for a class
static Object reconstruct(OpenType openType, Type type, Object value, Object context)
          Reconstruct a type from an object
static Object reconstruct(Type type, Object value, Object context)
          Reconstruct a type from an object
static Object reconstructArrayData(OpenType openType, Type type, Object value, Object context)
          Reconstruct an array type
static Object reconstructCompositeData(OpenType openType, Type type, Object value, Object context)
          Reconstruct a composite type
static Object reconstructTabularData(OpenType openType, Type type, Object value, Object context)
          Reconstruct a tabular type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAP_KEY

public static final String MAP_KEY
The map key

See Also:
Constant Field Values

MAP_VALUE

public static final String MAP_VALUE
The map value

See Also:
Constant Field Values

MAP_INDEX_NAMES

public static final String[] MAP_INDEX_NAMES
Map index names


MAP_ITEM_NAMES

public static final String[] MAP_ITEM_NAMES
Map item names

Constructor Detail

MXBeanUtils

public MXBeanUtils()
Method Detail

getOpenType

public static OpenType getOpenType(Type type)
Get the OpenType for a class

Parameters:
type - the type
Returns:
the open type

getSimpleType

public static SimpleType getSimpleType(Class<?> type)
                                throws Exception
Get the SimpleType for a class

Parameters:
type - the type
Returns:
the open type
Throws:
Exception - for any error

checkType

public static OpenType checkType(Type type)
Get the for a class that is not composite

Parameters:
type - the type
Returns:
the open type or null if composite

createCompositeDataProxy

public static <T> T createCompositeDataProxy(Class<T> intf,
                                             CompositeData compositeData)
Create a composite data proxy

Type Parameters:
T - the interface type
Parameters:
intf - the interface type
compositeData - the composite data
Returns:
the proxy

construct

public static Object construct(Type type,
                               Object value,
                               Object context)
                        throws Exception
Construct some open data

Parameters:
type - the type
value - the value
context - the context
Returns:
the open data
Throws:
Exception - for any error

construct

public static Object construct(OpenType openType,
                               Object value,
                               Object context)
                        throws Exception
Construct some open data

Parameters:
openType - the open type
value - the value
context - the context
Returns:
the open data
Throws:
Exception - for any error

reconstruct

public static Object reconstruct(Type type,
                                 Object value,
                                 Object context)
                          throws Exception
Reconstruct a type from an object

Parameters:
type - the type
value - the value
context - for error reporting
Returns:
the object
Throws:
Exception - for any error

reconstruct

public static Object reconstruct(OpenType openType,
                                 Type type,
                                 Object value,
                                 Object context)
                          throws Exception
Reconstruct a type from an object

Parameters:
openType - the open type
type - the type
value - the value
context - for error reporting
Returns:
the object
Throws:
Exception - for any error

checkSimpleType

public static SimpleType checkSimpleType(Type type)
Get the SimpleType for a class

Parameters:
type - the type
Returns:
the simple type or null if not a simple type

checkEnum

public static SimpleType checkEnum(Type type)
Get the simple type for an enum

Parameters:
type - the type
Returns:
return the enum type or null if it is not an enum

constructSimpleData

public static Object constructSimpleData(Object value)
Construct a simple type open data

Parameters:
value - the value
Returns:
the simple type

checkArray

public static ArrayType checkArray(Type type)
Get the array type for a class

Parameters:
type - the type
Returns:
return the array type or null if it is not an array

checkCollection

public static ArrayType checkCollection(Type type)
Get the collection type for a class

Parameters:
type - the type
Returns:
return the array type or null if it is not a collection

checkCollectionClass

public static ArrayType checkCollectionClass(Class clazz)
Get the collection type for a class

Parameters:
clazz - the class
Returns:
return the array type or null if it is not a collection

constructArrayData

public static Object constructArrayData(OpenType openType,
                                        Object value,
                                        Object context)
                                 throws Exception
Construct an array type open data

Parameters:
openType - the open type
value - the value
context - the context
Returns:
the open data
Throws:
Exception - for any error

reconstructArrayData

public static Object reconstructArrayData(OpenType openType,
                                          Type type,
                                          Object value,
                                          Object context)
                                   throws Exception
Reconstruct an array type

Parameters:
openType - the open type
type - the type
value - the value
context - the context
Returns:
the value
Throws:
Exception - for any error

checkMap

public static TabularType checkMap(Type type)
Get the map type for a class

Parameters:
type - the type
Returns:
return the tabular type or null if it is not a collection

checkMapClass

public static TabularType checkMapClass(Class<?> clazz)
Get the map type for a class

Parameters:
clazz - the class
Returns:
return the tabular type or null if it is not a collection

createMapType

public static TabularType createMapType(Type keyType,
                                        Type valueType)
Create a map type

Parameters:
keyType - the key type
valueType - the value type
Returns:
the map type

constructTabularData

public static Object constructTabularData(OpenType openType,
                                          Object value,
                                          Object context)
                                   throws Exception
Construct a tabular type open data

Parameters:
openType - the open type
value - the value
context - the context
Returns:
the open data
Throws:
Exception - for any error

reconstructTabularData

public static Object reconstructTabularData(OpenType openType,
                                            Type type,
                                            Object value,
                                            Object context)
                                     throws Exception
Reconstruct a tabular type

Parameters:
openType - the open type
type - the type
value - the value
context - the context
Returns:
the value
Throws:
Exception - for any error

constructCompositeData

public static Object constructCompositeData(OpenType openType,
                                            Object value,
                                            Object context)
                                     throws Exception
Construct composite type open data

Parameters:
openType - the open type
value - the value
context - the context
Returns:
the open data
Throws:
Exception - for any error

reconstructCompositeData

public static Object reconstructCompositeData(OpenType openType,
                                              Type type,
                                              Object value,
                                              Object context)
                                       throws Exception
Reconstruct a composite type

Parameters:
openType - the open type
type - the type
value - the value
context - the context
Returns:
the value
Throws:
Exception - for any error

getCompositeDataKey

public static String getCompositeDataKey(Method method)
Get the key for a composite data getter method

Parameters:
method - the method
Returns:
the key

getCompositeDataMethod

public static Method getCompositeDataMethod(Class clazz,
                                            String key,
                                            boolean isBoolean)
                                     throws Exception
Get the key for a composite data getter method

Parameters:
clazz - the class
key - the key
isBoolean - whether it is boolean
Returns:
the method
Throws:
Exception - for any error

createMXBean

public static DynamicMBean createMXBean(Object resource,
                                        Class<?> mxbeanInterface)
Create a new MXBean

Parameters:
resource - the resource
mxbeanInterface - the interface
Returns:
the MXBean

JBossMX Parent POM 6.0.0.GA

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.