Search in sources :

Example 56 with OpenDataException

use of javax.management.openmbean.OpenDataException in project openj9 by eclipse.

the class TestMonitorInfo method createGoodMonitorInfoCompositeType.

/**
 * @return <code>CompositeType</code> for use when wrapping up
 *         <code>MonitorInfo</code> objects in <code>CompositeData</code>s.
 */
static CompositeType createGoodMonitorInfoCompositeType() {
    CompositeType result = null;
    try {
        String[] typeNames = { "className", "identityHashCode", "lockedStackFrame", "lockedStackDepth" };
        String[] typeDescs = { "className", "identityHashCode", "lockedStackFrame", "lockedStackDepth" };
        OpenType[] typeTypes = { SimpleType.STRING, SimpleType.INTEGER, createStackTraceElementCompositeTypeObject(), SimpleType.INTEGER };
        result = new CompositeType(MonitorInfo.class.getName(), MonitorInfo.class.getName(), typeNames, typeDescs, typeTypes);
    } catch (OpenDataException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return result;
}
Also used : OpenType(javax.management.openmbean.OpenType) OpenDataException(javax.management.openmbean.OpenDataException) CompositeType(javax.management.openmbean.CompositeType)

Example 57 with OpenDataException

use of javax.management.openmbean.OpenDataException in project openj9 by eclipse.

the class TestMonitorInfo method createGoodCompositeData.

/**
 * @return a new <code>CompositeData</code> instance representing a
 *         <code>MonitorInfo</code>.
 */
static CompositeData createGoodCompositeData() {
    CompositeData result = null;
    String[] names = { "className", "identityHashCode", "lockedStackFrame", "lockedStackDepth" };
    Object[] values = { /* className */
    new String(GOOD_CD_CLASSNAME), /* identityHashCode */
    Integer.valueOf(GOOD_CD_IDHASHCODE), /* lockedStackFrame */
    createGoodStackTraceElementCompositeData(), /* lockedStackDepth */
    Integer.valueOf(GOOD_CD_STACKDEPTH) };
    CompositeType cType = createGoodMonitorInfoCompositeType();
    try {
        result = new CompositeDataSupport(cType, names, values);
    } catch (OpenDataException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return result;
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) CompositeData(javax.management.openmbean.CompositeData) CompositeDataSupport(javax.management.openmbean.CompositeDataSupport) CompositeType(javax.management.openmbean.CompositeType)

Example 58 with OpenDataException

use of javax.management.openmbean.OpenDataException in project openj9 by eclipse.

the class TestLockInfo method createGoodCompositeData.

/**
 * @return a new <code>CompositeData</code> instance representing a
 *         <code>LockInfo</code>.
 */
static CompositeData createGoodCompositeData() {
    CompositeData result = null;
    String[] names = { "className", "identityHashCode" };
    Object[] values = { /* className */
    new String(GOOD_CD_CLASSNAME), /* identityHashCode */
    Integer.valueOf(GOOD_CD_IDHASHCODE) };
    CompositeType cType = createGoodLockInfoCompositeType();
    try {
        result = new CompositeDataSupport(cType, names, values);
    } catch (OpenDataException e) {
        e.printStackTrace();
    }
    return result;
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) CompositeData(javax.management.openmbean.CompositeData) CompositeDataSupport(javax.management.openmbean.CompositeDataSupport) CompositeType(javax.management.openmbean.CompositeType)

Example 59 with OpenDataException

use of javax.management.openmbean.OpenDataException in project openj9 by eclipse.

the class TestLockInfo method createGoodLockInfoCompositeType.

/**
 * @return <code>CompositeType</code> for use when wrapping up
 *         <code>LockInfo</code> objects in <code>CompositeData</code>s.
 */
static CompositeType createGoodLockInfoCompositeType() {
    CompositeType result = null;
    try {
        String[] typeNames = { "className", "identityHashCode" };
        String[] typeDescs = { "className", "identityHashCode" };
        OpenType[] typeTypes = { SimpleType.STRING, SimpleType.INTEGER };
        result = new CompositeType(LockInfo.class.getName(), LockInfo.class.getName(), typeNames, typeDescs, typeTypes);
    } catch (OpenDataException e) {
        e.printStackTrace();
        Assert.fail("Unexpected exception occurred.");
    }
    return result;
}
Also used : OpenType(javax.management.openmbean.OpenType) OpenDataException(javax.management.openmbean.OpenDataException) CompositeType(javax.management.openmbean.CompositeType)

Example 60 with OpenDataException

use of javax.management.openmbean.OpenDataException in project openj9 by eclipse.

the class TestThreadInfo method createGoodCompositeDataNoLockInfo.

/**
 * @return a new <code>CompositeData</code> instance representing a
 *         <code>ThreadInfo</code>, does not contain 'LockInfo'.
 */
protected static CompositeData createGoodCompositeDataNoLockInfo() {
    CompositeData result = null;
    CompositeType cType = createGoodThreadInfoCompositeTypeNoLockInfo();
    try {
        result = new CompositeDataSupport(cType, typeNamesGlobal, valuesGoodCompositeDataNoLockInfo);
    } catch (OpenDataException e) {
        e.printStackTrace();
    }
    return result;
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) CompositeData(javax.management.openmbean.CompositeData) CompositeDataSupport(javax.management.openmbean.CompositeDataSupport) CompositeType(javax.management.openmbean.CompositeType)

Aggregations

OpenDataException (javax.management.openmbean.OpenDataException)139 CompositeType (javax.management.openmbean.CompositeType)94 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)67 CompositeData (javax.management.openmbean.CompositeData)54 OpenType (javax.management.openmbean.OpenType)52 TabularType (javax.management.openmbean.TabularType)33 TabularDataSupport (javax.management.openmbean.TabularDataSupport)32 HashMap (java.util.HashMap)14 Map (java.util.Map)12 TabularData (javax.management.openmbean.TabularData)11 ObjectName (javax.management.ObjectName)8 ArrayType (javax.management.openmbean.ArrayType)8 Type (java.lang.reflect.Type)5 ArrayList (java.util.ArrayList)5 Method (java.lang.reflect.Method)4 Comparator (java.util.Comparator)4 MBeanServer (javax.management.MBeanServer)4 SimpleType (javax.management.openmbean.SimpleType)4 IOException (java.io.IOException)3 InvalidObjectException (java.io.InvalidObjectException)3