Java 8 LockInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 LockInfo class.

This code example shows how to use the following methods:getClassName, getIdentityHashCode
        } 
    } 
 
    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());
        } 
    } 
 
    public static void badNameCompositeData() throws Exception {
        CompositeType ct =
            new CompositeType("MyCompositeType",
                              "CompositeType for ThreadInfo", 
5
CodeRank
This code example shows how to use the following methods:getClassName, getIdentityHashCode
            } 
        } 
    } 
 
    private void formatLock(final StringBuilder sb, final LockInfo lock) {
        sb.append('<').append(lock.getIdentityHashCode()).append("> (a ");
        sb.append(lock.getClassName()).append(')');
    } 
 
    private void formatState(final StringBuilder sb, final ThreadInfo info) {
        final Thread.State state = info.getThreadState();
        sb.append(state);
        switch (state) {
            case BLOCKED: {
                sb.append(" (on object monitor owned by \"");
                sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId()).append(')');
                break; 
            } 
            case WAITING: {
                final StackTraceElement element = info.getStackTrace()[0];
4
CodeRank
See Code Examples for Java 8 LockInfo Methods: