当前位置: 首页>>代码示例>>Java>>正文


Java JPDAThread类代码示例

本文整理汇总了Java中org.netbeans.api.debugger.jpda.JPDAThread的典型用法代码示例。如果您正苦于以下问题:Java JPDAThread类的具体用法?Java JPDAThread怎么用?Java JPDAThread使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JPDAThread类属于org.netbeans.api.debugger.jpda包,在下文中一共展示了JPDAThread类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: currentStackFrameChanged

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
private void currentStackFrameChanged(CallStackFrame csf) {
    if (csf != null && csf.getClassName().startsWith(JSUtils.NASHORN_SCRIPT)) {
        JPDAThread thread = csf.getThread();
        suspendedNashornThread = new WeakReference<>(thread);
        try {
            Object node = dvSupport.getClass().getMethod("get", JPDAThread.class).invoke(dvSupport, thread);
            boolean explicitCollaps;
            synchronized (this) {
                explicitCollaps = collapsedExplicitly.contains(node);
            }
            if (!explicitCollaps) {
                fireNodeExpanded(node);
            }
        } catch (IllegalAccessException | IllegalArgumentException |
                 InvocationTargetException | NoSuchMethodException |
                 SecurityException ex) {
            Exceptions.printStackTrace(ex);
        }
    } else {
        suspendedNashornThread = NO_THREAD;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:DebuggingJSTreeExpansionModelFilter.java

示例2: getTheURL

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
private String getTheURL(SourcePath sourcePath, JPDAThread currentThread, String language) {
        return sourcePath.getURL(currentThread, language);
//        final String url;
//        String sPath;
//        try {
//            sPath = currentThread.getSourcePath (language);
//        } catch (AbsentInformationException e) {
//            sPath = "";
//        }
//        if (sPath.length() > 0) {
//            url = sourcePath.getURL (SourcePath.convertSlash (sPath), true);
//        } else {
//            String className = currentThread.getClassName ();
//            if (className.length() == 0) {
//                url = null;
//            } else {
//                url = sourcePath.getURL (SourcePath.convertClassNameToRelativePath (className), true);
//            }
//        }
//        return url;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:CurrentThreadAnnotationListener.java

示例3: stopHere

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
/**
 * Test whether we should stop here according to the smart-stepping rules.
 */
StopOrStep stopHere(JPDAThread t) {
    CallStackFrame topFrame = null;
    try {
        CallStackFrame[] topFrameArr = t.getCallStack(0, 1);
        if (topFrameArr.length > 0) {
            topFrame = topFrameArr[0];
        }
    } catch (AbsentInformationException aiex) {}
    if (topFrame != null) {
        return getCompoundSmartSteppingListener().stopAt
                    (lookupProvider, topFrame, getSmartSteppingFilter());
    } else {
        return getCompoundSmartSteppingListener().stopHere
                    (lookupProvider, t, getSmartSteppingFilter()) ?
                StopOrStep.stop() : StopOrStep.skip();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:JPDADebuggerImpl.java

示例4: annotate

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
private void annotate(JPDAThread t, boolean isCurrentThread) {
    //System.err.println("annotate("+t+", "+isCurrentThread+")");
    synchronized(this) {
        Object annotation = threadAnnotations.remove(t);
        //System.err.println("SCHEDULE removal of "+annotation+" for "+t);
        if (annotation != null) {
            threadsToAnnotate.remove(t);
            annotationsToRemove.add(annotation);
            task.schedule(ANNOTATION_SCHEDULE_TIME);
        }
        if (!isCurrentThread && t.isSuspended()) {
            threadsToAnnotate.add(t);
            FutureAnnotation future = futureAnnotations.get(t);
            if (future == null) {
                future = new FutureAnnotation(t);
            }
            threadAnnotations.put(t, future);
            futureAnnotations.put(t, future);
            task.schedule(ANNOTATION_SCHEDULE_TIME);
            //System.err.println("SCHEDULE annotation of "+t+", have future = "+future);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:CurrentThreadAnnotationListener.java

示例5: translateOnThread

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
/**
 * Translates a debuggee Mirror to a thread-specific wrapper object.
 *
 * @param thread the thread on which the object lives
 * @param o the Mirror object in the debuggee
 * @param v an additional argument used for the translation
 * @return translated object or <code>null</code> when the argument
 *         is not possible to translate.
 */
public Object translateOnThread (JPDAThread thread, Mirror o, Object v) {
    Object r = null;
    boolean verify = false;
    synchronized (threadCache) {
        Map<Mirror, WeakReference<Object>> cache = threadCache.get(thread);
        if (cache == null) {
            cache = new WeakHashMap<>();
            threadCache.put(thread, cache);
        }
        WeakReference wr = cache.get (o);
        if (wr != null)
            r = wr.get ();
        if (r == null) {
            r = createTranslation (o, v);
            cache.put (o, new WeakReference<Object>(r));
        } else {
            verify = true;
        }
    }
    if (verify) {
        verifyTranslation(r, o, v);
    }
    return r;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:ObjectTranslation.java

示例6: getIconBase

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
public static String getIconBase(JPDAThread thread) {
    Breakpoint b = thread.getCurrentBreakpoint();
    if (b != null) {
        if (b instanceof LineBreakpoint) {
            String condition = ((LineBreakpoint) b).getCondition();
            if (condition != null && condition.length() > 0) {
                return THREAD_AT_BRKT_CONDITIONAL;
            } else {
                return THREAD_AT_BRKT_LINE;
            }
        } else {
            return THREAD_AT_BRKT_NONLINE;
        }
    }
    if (thread.isSuspended()) {
        return THREAD_SUSPENDED;
    } else if (JPDAThread.STATE_ZOMBIE == thread.getState()) {
        return THREAD_ZOMBIE;
    } else {
        return THREAD_RUNNING;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:DebuggingNodeModel.java

示例7: fireDisplayNameChanged

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
private void fireDisplayNameChanged (Object node) {
    if (node instanceof JPDAThread) {
        node = dvSupport.get((JPDAThread) node);
    } else if (node instanceof JPDAThreadGroup) {
        node = dvSupport.get((JPDAThreadGroup) node);
    }
    List<ModelListener> ls;
    synchronized (listeners) {
        ls = new ArrayList<ModelListener>(listeners);
    }
    ModelEvent event = new ModelEvent.NodeChanged(this, node,
            ModelEvent.NodeChanged.DISPLAY_NAME_MASK);
    for (ModelListener ml : ls) {
        ml.modelChanged (event);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:DebuggingNodeModel.java

示例8: propertyChange

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
    JPDAThread t = tr.get();
    if (t != null) {
        //if (DebuggingTreeModel.isMethodInvoking(t)) return ;
        if (JPDAThread.PROP_BREAKPOINT.equals(evt.getPropertyName()) &&
            t.isSuspended() && t.getCurrentBreakpoint() != null) {
            synchronized (this) {
                shouldExpand = true;
            }
        }
        synchronized (this) {
            if (task == null) {
                task = rp.create(new Refresher());
            }
            task.schedule(100);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:DebuggingNodeModel.java

示例9: run

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
public void run() {
    JPDAThread thread = tr.get();
    if (thread != null) {
        if (preferences.getBoolean(DebuggingTreeModel.SHOW_SUSPENDED_THREADS_ONLY, false)) {
            fireNodeChanged(TreeModel.ROOT);
        } else {
            fireNodeChanged(thread);
        }
        boolean shouldExpand;
        synchronized (this) {
            shouldExpand = ThreadStateUpdater.this.shouldExpand;
            ThreadStateUpdater.this.shouldExpand = false;
        }
        if (shouldExpand) {
            DebuggingTreeExpansionModelFilter.expand(debugger, dvSupport.get(thread));
        }
        if (preferences.getBoolean(DebuggingTreeModel.SHOW_THREAD_GROUPS, false)) {
            JPDAThreadGroup group = thread.getParentThreadGroup();
            while (group != null) {
                fireNodeChanged(group);
                group = group.getParentThreadGroup();
            } // while
        } // if
    } // if
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:DebuggingNodeModel.java

示例10: updateLockerThreads

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
private Pair<List<JPDAThread>, List<JPDAThread>> updateLockerThreads(
        Map<ThreadReference, ObjectReference> lockedThreadsWithMonitors,
        ObjectReference waitingMonitor) throws InternalExceptionWrapper,
                                               VMDisconnectedExceptionWrapper,
                                               ObjectCollectedExceptionWrapper,
                                               IllegalThreadStateExceptionWrapper {
    List<JPDAThread> oldLockerThreadsList;
    List<JPDAThread> newLockerThreadsList;
    synchronized (lockerThreadsLock) {
        oldLockerThreadsList = lockerThreadsList;
        if (lockedThreadsWithMonitors != null) {
            //lockerThreads2 = lockedThreadsWithMonitors;
            lockerThreadsMonitor = waitingMonitor;
            if (!submitMonitorEnteredFor(waitingMonitor)) {
                submitCheckForMonitorEntered(waitingMonitor);
            }
            lockerThreadsList = new ThreadListDelegate(debugger, new ArrayList(lockedThreadsWithMonitors.keySet()));
        } else {
            //lockerThreads2 = null;
            lockerThreadsMonitor = null;
            lockerThreadsList = null;
        }
        newLockerThreadsList = lockerThreadsList;
    }
    return Pair.of(oldLockerThreadsList, newLockerThreadsList);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:JPDAThreadImpl.java

示例11: popToHere

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
private static void popToHere (final CallStackFrame frame) {
    try {
        JPDAThread t = frame.getThread ();
        CallStackFrame[] stack = t.getCallStack ();
        int i, k = stack.length;
        if (k < 2) return ;
        for (i = 0; i < k; i++)
            if (stack [i].equals (frame)) {
                if (i > 0) {
                    stack [i - 1].popFrame ();
                }
                return;
            }
    } catch (AbsentInformationException ex) {
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:DebuggingActionsProvider.java

示例12: stackToCLBD

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
static void stackToCLBD(List<JPDAThread> threads) {
    StringBuffer frameStr = new StringBuffer(512);
    for (JPDAThread t : threads) {
        if (frameStr.length() > 0) {
            frameStr.append('\n');
        }
        frameStr.append("\"");
        frameStr.append(t.getName());
        frameStr.append("\"\n");
        appendStackInfo(frameStr, t);
    }
    Clipboard systemClipboard = getClipboard();
    Transferable transferableText =
            new StringSelection(frameStr.toString());
    systemClipboard.setContents(
            transferableText,
            null);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:DebuggingActionsProvider.java

示例13: isExpanded

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
/**
 * Defines default state (collapsed, expanded) of given node.
 *
 * @param node a node
 * @return default state (collapsed, expanded) of given node
 */
public boolean isExpanded (Object node) 
throws UnknownTypeException {
    synchronized (this) {
        if (expandedNodes.contains(node)) {
            return true;
        }
        if (collapsedNodes.contains(node)) {
            return false;
        }
    }
    // Default behavior follows:
    if (node instanceof MonitorModel.ThreadWithBordel) 
        return false;
    if (node instanceof JPDAThreadGroup)
        return true;
    if (node instanceof JPDAThread)
        return false;
    throw new UnknownTypeException (node);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ThreadsTreeExpansionModel.java

示例14: getTopLevelThreadsAndGroups

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
private Object[] getTopLevelThreadsAndGroups() {
    List result = new LinkedList();
    Set groups = new HashSet();
    for (JPDAThread thread : debugger.getThreadsCollector().getAllThreads()) {
        JPDAThreadGroup group = thread.getParentThreadGroup();
        if (group == null) {
            result.add(dvSupport.get(thread));
        } else {
            while (group.getParentThreadGroup() != null) {
                group = group.getParentThreadGroup();
            } // while
            groups.add(dvSupport.get(group));
        } // if
    } // for
    result.addAll(groups);
    return result.toArray();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:DebuggingTreeModel.java

示例15: setValueAt

import org.netbeans.api.debugger.jpda.JPDAThread; //导入依赖的package包/类
public void setValueAt (Object row, String columnID, Object value) 
throws UnknownTypeException {
    if (row instanceof MonitorModel.ThreadWithBordel) 
        row = ((MonitorModel.ThreadWithBordel) row).getOriginalThread();
    if (row instanceof JPDAThreadGroup) {
        if (THREAD_SUSPENDED_COLUMN_ID.equals (columnID)) {
            if (((Boolean) value).booleanValue ())
                ((JPDAThreadGroup) row).suspend ();
            else
                ((JPDAThreadGroup) row).resume ();
            fireTableValueChanged (row, Constants.THREAD_SUSPENDED_COLUMN_ID);
            return;
        }
    }
    if (row instanceof JPDAThread) {
        if (THREAD_SUSPENDED_COLUMN_ID.equals (columnID)) {
            if (value.equals (Boolean.TRUE))
                ((JPDAThread) row).suspend ();
            else 
                ((JPDAThread) row).resume ();
            fireTableValueChanged (row, Constants.THREAD_SUSPENDED_COLUMN_ID);
            return;
        }
    }
    throw new UnknownTypeException (row);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ThreadsTableModel.java


注:本文中的org.netbeans.api.debugger.jpda.JPDAThread类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。