public class MonitorInfo extends LockInfo
| Constructor and Description |
|---|
MonitorInfo(String className, int identityHashCode, int stackDepth, StackTraceElement stackFrame)
构建一个
MonitorInfo对象。
|
| Modifier and Type | Method and Description |
|---|---|
static MonitorInfo |
from(CompositeData cd)
返回一个给定的
CompositeData代表
MonitorInfo对象。
|
int |
getLockedStackDepth()
返回在对象监视器锁定的堆栈跟踪中的深度。
|
StackTraceElement |
getLockedStackFrame()
返回锁定对象监视器的堆栈帧。
|
getClassName, getIdentityHashCode, toStringpublic MonitorInfo(String className, int identityHashCode, int stackDepth, StackTraceElement stackFrame)
className -锁的对象的类的完全限定名。
identityHashCode -锁定对象的
identity hash code。
stackDepth -深度的堆栈跟踪,监控锁定对象。
stackFrame -堆栈帧锁定对象监控。
IllegalArgumentException -如果
stackDepth≥0但
stackFrame是
null,或
stackDepth<0但不
null
stackFrame。
public int getLockedStackDepth()
ThreadInfo.getStackTrace()方法返回的
StackTraceElement数组的索引。
public StackTraceElement getLockedStackFrame()
public static MonitorInfo from(CompositeData cd)
LockInfo类中指定的属性:
mapped type
Attribute Name Type lockedStackFrame CompositeData as specified in the stackTrace attribute defined in the ThreadInfo.frommethod.lockedStackDepth java.lang.Integer
cd -
CompositeData代表
MonitorInfo
IllegalArgumentException -如果
cd并不代表上述属性
MonitorInfo。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.