本文整理汇总了Java中java.lang.management.LockInfo.getIdentityHashCode方法的典型用法代码示例。如果您正苦于以下问题:Java LockInfo.getIdentityHashCode方法的具体用法?Java LockInfo.getIdentityHashCode怎么用?Java LockInfo.getIdentityHashCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.management.LockInfo
的用法示例。
在下文中一共展示了LockInfo.getIdentityHashCode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LocalLockInfo
import java.lang.management.LockInfo; //导入方法依赖的package包/类
public LocalLockInfo(Serializable locatility, LockInfo sync) {
super();
this.locatility = locatility;
// LockInfo and Monitor info aren't serializable, so copy the information from
// them. For backwards compatibility, use the LI class which is used
// in older versions of gemfire.
if (sync instanceof MonitorInfo) {
this.info = new LI(sync.getClassName(), sync.getIdentityHashCode(),
((MonitorInfo) sync).getLockedStackFrame());
} else {
this.info = new LI(sync.getClassName(), sync.getIdentityHashCode());
}
}
示例2: checkLockInfo
import java.lang.management.LockInfo; //导入方法依赖的package包/类
private static void checkLockInfo(LockInfo li)
throws Exception {
if (!li.getClassName().equals(lockInfo.getClassName())) {
throw new RuntimeException("Class Name = " +
li.getClassName() + " expected = " + lockInfo.getClassName());
}
if (li.getIdentityHashCode() != lockInfo.getIdentityHashCode()) {
throw new RuntimeException("Class Name = " +
li.getIdentityHashCode() + " expected = " +
lockInfo.getIdentityHashCode());
}
}
示例3: getLockInfo
import java.lang.management.LockInfo; //导入方法依赖的package包/类
@Override
public LI getLockInfo(ThreadInfo threadInfo) {
LockInfo lockInfo= threadInfo.getLockInfo();
if(lockInfo == null) {
return null;
}
return new LI(lockInfo.getClassName(), lockInfo.getIdentityHashCode());
}
示例4: getSynchronizer
import java.lang.management.LockInfo; //导入方法依赖的package包/类
static @Nonnull ThreadLock getSynchronizer(final LockInfo info) {
return new ThreadLock(info.getClassName(), info.getIdentityHashCode());
}