use of javax.management.openmbean.CompositeDataSupport 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 */
new Integer(GOOD_CD_IDHASHCODE) };
CompositeType cType = createGoodLockInfoCompositeType();
try {
result = new CompositeDataSupport(cType, names, values);
} catch (OpenDataException e) {
e.printStackTrace();
}
return result;
}
use of javax.management.openmbean.CompositeDataSupport in project openj9 by eclipse.
the class GcInfoUtil method toCompositeData.
/**
* @param info the garbage collection information
* @return a new {@link CompositeData} instance that represents the supplied <code>info</code> object
*/
public static CompositeData toCompositeData(GcInfo info) {
CompositeData result = null;
if (null != info) {
CompositeType type = getCompositeType();
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
String[] names = { "index", "startTime", "endTime", "usageBeforeGc", "usageAfterGc" };
Object[] values = { Long.valueOf(info.getId()), Long.valueOf(info.getStartTime()), Long.valueOf(info.getEndTime()), MemoryUsageUtil.toTabularData(info.getMemoryUsageBeforeGc()), MemoryUsageUtil.toTabularData(info.getMemoryUsageAfterGc()) };
try {
result = new CompositeDataSupport(type, names, values);
} catch (OpenDataException e) {
if (ManagementUtils.VERBOSE_MODE) {
e.printStackTrace(System.err);
}
}
}
return result;
}
use of javax.management.openmbean.CompositeDataSupport in project openj9 by eclipse.
the class GarbageCollectionNotificationInfoUtil method toCompositeData.
/**
* @param info the garbage collection notification information
* @return a new {@link CompositeData} instance that represents the supplied <code>info</code> object
*/
public static CompositeData toCompositeData(GarbageCollectionNotificationInfo info) {
CompositeData result = null;
if (info != null) {
CompositeType type = getCompositeType();
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
String[] names = { "gcName", "gcAction", "gcCause", "gcInfo" };
Object[] values = { info.getGcName(), info.getGcAction(), info.getGcCause(), GcInfoUtil.toCompositeData(info.getGcInfo()) };
try {
result = new CompositeDataSupport(type, names, values);
} catch (OpenDataException e) {
if (ManagementUtils.VERBOSE_MODE) {
e.printStackTrace(System.err);
}
}
}
return result;
}
use of javax.management.openmbean.CompositeDataSupport in project openj9 by eclipse.
the class TestThreadInfo method createGoodStackTraceCompositeData.
/**
* @return new array of <code>CompositeData</code> representing an array
* of <code>StackTraceElement</code>.
*/
protected static CompositeData[] createGoodStackTraceCompositeData() {
// Let's make the array have three elements. Doesn't matter that
// they are all identical.
CompositeData[] result = new CompositeData[3];
CompositeType cType = createGoodStackTraceElementCompositeType();
String[] names = TestMisc.getJava9STEMethodNames();
Object[] values = { new String("foo.bar.Blobby"), new String("takeOverWorld"), new String("Blobby.java"), new Integer(2100), new Boolean(false), new String("myModuleName"), new String("myModuleVersion"), new String("myClassLoaderName") };
for (int i = 0; i < result.length; i++) {
try {
result[i] = new CompositeDataSupport(cType, names, values);
} catch (OpenDataException e) {
e.printStackTrace();
}
}
// end for
return result;
}
use of javax.management.openmbean.CompositeDataSupport in project openj9 by eclipse.
the class TestThreadInfo method createGoodCompositeData.
/**
* @return a new <code>CompositeData</code> instance representing a
* <code>ThreadInfo</code>.
*/
protected static CompositeData createGoodCompositeData() {
CompositeData result = null;
CompositeType cType = createGoodThreadInfoCompositeType();
try {
result = new CompositeDataSupport(cType, typeNamesGlobal, valuesCompositeDataGlobal);
} catch (OpenDataException e) {
e.printStackTrace();
}
return result;
}
Aggregations