- java.lang.Object
-
- java.lang.management.LockInfo
-
- java.lang.management.MonitorInfo
-
public class MonitorInfo extends LockInfo
- 从以下版本开始:
- 1.6
-
-
构造方法摘要
构造方法 Constructor 描述 MonitorInfo(String className, int identityHashCode, int stackDepth, StackTraceElement stackFrame)构造一个MonitorInfo对象。
-
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 static MonitorInfofrom(CompositeData cd)返回由给定的CompositeData表示的MonitorInfo对象。intgetLockedStackDepth()返回堆栈跟踪中对象监视器被锁定的深度。StackTraceElementgetLockedStackFrame()返回锁定对象监视器的堆栈帧。-
Methods inherited from class java.lang.management.LockInfo
getClassName, getIdentityHashCode, toString
-
-
-
-
构造方法详细信息
-
MonitorInfo
public MonitorInfo(String className, int identityHashCode, int stackDepth, StackTraceElement stackFrame)
构造一个MonitorInfo对象。- 参数
-
className- 锁定对象的类的完全限定名称。 -
identityHashCode- 锁定对象的identity hash code。 -
stackDepth- 对象监视器被锁定的堆栈跟踪中的深度。 -
stackFrame- 锁定对象监视器的堆栈框架。 - 异常
-
IllegalArgumentException- 如果stackDepth0,但stackFrame为null,或stackDepth<0,但stackFrame不为null。
-
-
方法详细信息
-
getLockedStackDepth
public int getLockedStackDepth()
返回堆栈跟踪中对象监视器被锁定的深度。 深度是ThreadInfo.getStackTrace()方法返回的StackTraceElement数组的索引。- 结果
- 堆栈跟踪中对象监视器被锁定的深度,或负数,如果不可用。
-
getLockedStackFrame
public StackTraceElement getLockedStackFrame()
返回锁定对象监视器的堆栈帧。- 结果
-
StackTraceElement锁定对象监视器,或null如果不可用)。
-
from
public static MonitorInfo from(CompositeData cd)
返回由给定的CompositeData表示的MonitorInfo对象。 给定的CompositeData必须包含以下属性以及LockInfo类别中的mapped type中指定的属性:Attribute Name Type lockedStackFrame CompositeData as specified in the stackTrace attribute defined in theThreadInfo.frommethod.lockedStackDepth java.lang.Integer- 参数
-
cd-CompositeData代表MonitorInfo - 结果
-
一个
MonitorInfo通过表示对象cd如果cd不是null;null否则。 - 异常
-
IllegalArgumentException- 如果cd不代表具有上述属性的MonitorInfo。
-
-