return nativeRowId;
}
public OID mapToIndex(Object rowIdentifier) {
Object[] key = (Object[])rowIdentifier;
OID index = new OID(jvmMemManagerIndexSupport.mapToIndex(key[0]));
index.append(jvmMemPoolIndexSupport.mapToIndex(key[1]));
return index;
}
public Object mapToRowIdentifier(OID rowIndex) {
if (rowIndex == null) {
return null;
}
Object[] rowIdentifier = new Object[2];
rowIdentifier[0] =
jvmMemManagerIndexSupport.mapToRowIdentifier(
new OID(rowIndex.toIntArray(), 0, 1));
rowIdentifier[1] =
jvmMemPoolIndexSupport.mapToRowIdentifier(
new OID(rowIndex.toIntArray(), 1, 1));
return rowIdentifier;
}
}
));
ObjectName onameJvmThreading =
new ObjectName(ManagementFactory.THREAD_MXBEAN_NAME);
tableSupport.add(super.oidJvmThreadInstanceEntry,
new MBeanAttributeMOTableInfo(onameJvmThreading,
new MBeanInvokationKeyProvider(onameJvmThreading,
new TypedAttribute("AllThreadIds", long.class),
"getThreadInfo", true),
new TypedAttribute[] {
new TypedCompositeDataAttribute(new TypedAttribute("threadId", Long.class)),
new CombinedBitsType(new TypedAttribute[] {
new EnumBitsType("threadState", Thread.State.class, Thread.State.values(), 3),
new BooleanBitsType("inNative", 1),
new BooleanBitsType("suspended", 2)}),
new TypedCompositeDataAttribute(new TypedAttribute("blockedCount", Long.class)),
new TypedCompositeDataAttribute(new TypedAttribute("blockedTime", Long.class)),
new TypedCompositeDataAttribute(new TypedAttribute("waitedCount", Long.class)),
new TypedCompositeDataAttribute(new TypedAttribute("waitedTime", Long.class)),
new MBeanProxyType(server, onameJvmThreading, Long.class,
"getThreadUserTime",
new TypedCompositeDataAttribute(new TypedAttribute("threadId", long.class))) {
public Object transformFromNative(Object nativeValue, ObjectName objectName) {
Long result = (Long) super.transformFromNative(nativeValue, objectName);
if ((result == null) || (result.longValue() < 0)) {
return 0L;
}
return result;
}
},
new TypedCompositeDataAttribute(new TypedAttribute("threadName", String.class)),
new TypedCompositeDataAttribute(new TypedAttribute("lockOwnerName", String.class)),
new TypedCompositeDataAttribute(new TypedAttribute("lockOwnerId", Long.class)) {
public Object transformFromNative(Object nativeValue, ObjectName objectName) {
Long result = (Long)super.transformFromNative(nativeValue, objectName);
if ((result == null) || (result.longValue() < 0)) {
return "0.0";
}
OID rowPointer = new OID(JvmManagementMib.oidJvmThreadInstanceEntry);
rowPointer.append(JvmManagementMib.colJvmThreadInstId);
String index = Long.toHexString(result.longValue());
OctetString os = new OctetString();
os.fromHexString(index);
rowPointer.append(os.toSubIndex(true));
return rowPointer.toString();
}
}},
new String[] { "ThreadId" },
new JMXIndexSupport() {
public ObjectName mapToRowMBean(Object rowIdentifier) {