本文整理汇总了Java中org.netbeans.api.debugger.jpda.JPDAThread.isSuspended方法的典型用法代码示例。如果您正苦于以下问题:Java JPDAThread.isSuspended方法的具体用法?Java JPDAThread.isSuspended怎么用?Java JPDAThread.isSuspended使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.debugger.jpda.JPDAThread
的用法示例。
在下文中一共展示了JPDAThread.isSuspended方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
示例2: 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;
}
}
示例3: 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);
}
}
}
示例4: getActions
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
public Action[] getActions (Object node) throws UnknownTypeException {
if (node == TreeModel.ROOT)
return new Action [0];
if (node instanceof JPDAThreadGroup) {
return new Action [] {
RESUME_ACTION,
SUSPEND_ACTION,
};
} else
if (node instanceof JPDAThread) {
JPDAThread t = (JPDAThread) node;
boolean suspended = t.isSuspended ();
Action a = null;
if (suspended)
a = RESUME_ACTION;
else
a = SUSPEND_ACTION;
return new Action [] {
MAKE_CURRENT_ACTION,
a,
INTERRUPT_ACTION,
GO_TO_SOURCE_ACTION,
};
} else
throw new UnknownTypeException (node);
}
示例5: getThreadsState
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private int getThreadsState(JPDADebugger d) {
if (d.getState() != JPDADebugger.STATE_STOPPED) {
return d.getState();
}
// Verify whether really all threads are stopped
try {
java.lang.reflect.Method allThreadsMethod =
d.getClass().getMethod("getAllThreads", new Class[] {});
List<JPDAThread> threads = (List<JPDAThread>) allThreadsMethod.invoke(d, new Object[]{});
for (JPDAThread t : threads) {
if (!t.isSuspended()) {
return JPDADebugger.STATE_RUNNING;
}
}
return JPDADebugger.STATE_STOPPED;
} catch (Exception ex) {
return d.getState();
}
}
示例6: checkEnabled
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
@Override
protected void checkEnabled (int debuggerState) {
if (!getDebuggerImpl().canPopFrames()) {
setEnabled (
ActionsManager.ACTION_POP_TOPMOST_CALL,
false
);
return;
}
JPDAThread t;
if (debuggerState == JPDADebugger.STATE_STOPPED) {
t = getDebuggerImpl ().getCurrentThread ();
} else {
t = null;
}
boolean enabled;
if (t == null) {
enabled = false;
} else {
enabled = t.isSuspended();
}
setEnabled (
ActionsManager.ACTION_POP_TOPMOST_CALL,
enabled
);
}
示例7: propertyChange
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
if (!evt.getPropertyName().equals(JPDAThread.PROP_SUSPENDED)) return ;
JPDAThread t = tr.get();
if (t == null) return ;
// Refresh the children of the thread (stack frames) when the thread
// gets suspended or is resumed
// When thread is resumed because of a method invocation, do the
// refresh only if the method takes a long time.
boolean isMethodInvoking = "methodInvoke".equals(evt.getPropagationId()); // NOI18N
boolean suspended = t.isSuspended();
if (suspended || !isMethodInvoking) {
synchronized (this) {
if (task == null) {
task = RP.create(new Refresher());
}
int delay;
if (!suspended || wasMethodInvoke) {
delay = 1000;
} else {
delay = 200;
}
//Logger.getLogger("DEBUGGING").severe("isMethodInvoking = "+isMethodInvoking+", suspended = "+suspended+", wasMethodInvoke = "+wasMethodInvoke+" => delay = "+delay);
task.schedule(delay);
}
}
wasMethodInvoke = isMethodInvoking;
}
示例8: DeadlockDetectorImpl
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
DeadlockDetectorImpl(JPDADebugger debugger) {
debugger.addPropertyChangeListener(this);
List<JPDAThread> threads = debugger.getThreadsCollector().getAllThreads();
for (JPDAThread thread : threads) {
((Customizer) thread).addPropertyChangeListener(WeakListeners.propertyChange(this, thread));
if (thread.isSuspended()) {
synchronized (suspendedThreads) {
suspendedThreads.add(thread);
}
}
}
}
示例9: isSomeThreadRunning
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
public boolean isSomeThreadRunning() {
for (JPDAThread thread : getAllThreads()) {
if (!thread.isSuspended() && !((JPDAThreadImpl) thread).isMethodInvoking()) {
return true;
}
}
return false;
}
示例10: isSomeThreadSuspended
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
public boolean isSomeThreadSuspended() {
for (JPDAThread thread : getAllThreads()) {
if (thread.isSuspended() || ((JPDAThreadImpl) thread).isMethodInvoking()) {
return true;
}
}
return false;
}
示例11: propertyChange
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
if (JPDAThread.PROP_SUSPENDED.equals(evt.getPropertyName())) {
if ("methodInvoke".equals(evt.getPropagationId())) {
return ; // Ignore events associated with method invocations
}
JPDAThread thread = (JPDAThread) evt.getSource();
if (thread.isSuspended()) {
firePropertyChange(PROP_THREAD_SUSPENDED, null, thread);
} else {
firePropertyChange(PROP_THREAD_RESUMED, null, thread);
}
}
}
示例12: getDisplayName
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private static String getDisplayName(JPDAThread t, boolean showPackageNames, DebuggingNodeModel model) throws UnknownTypeException {
String name = t.getName();
JPDABreakpoint breakpoint = t.getCurrentBreakpoint();
if (((JPDAThreadImpl) t).isMethodInvoking()) {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_Invoking_Method", name);
}
if (breakpoint != null) {
return getThreadAtBreakpointDisplayName(name, breakpoint);
}
if (t.isSuspended()) {
String frame;
synchronized (frameDescriptionsByThread) {
frame = frameDescriptionsByThread.get(t);
if (t.isSuspended()) {
// Load it in any case to assure refreshes
loadFrameDescription(frame, t, showPackageNames, model);
}
}
if (frame != null) {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Suspended_At", name, frame);
} else {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Suspended", name);
}
} else if (JPDAThread.STATE_ZOMBIE == t.getState()) {
// Died, but is still around
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Zombie", name);
} else {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Running", name);
}
/*
int i = t.getState ();
switch (i) {
case JPDAThread.STATE_UNKNOWN:
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Unknown", name);
case JPDAThread.STATE_MONITOR:
if (frame != null) {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Monitor_At", name, frame);
} else {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Monitor", name);
}
case JPDAThread.STATE_NOT_STARTED:
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_NotStarted", name);
case JPDAThread.STATE_RUNNING:
if (frame != null) {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Running_At", name, frame);
} else {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Running", name);
}
case JPDAThread.STATE_SLEEPING:
if (frame != null) {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Sleeping_At", name, frame);
} else {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Sleeping", name);
}
case JPDAThread.STATE_WAIT:
if (frame != null) {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Waiting_At", name, frame);
} else {
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Waiting", name);
}
case JPDAThread.STATE_ZOMBIE:
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Zombie", name);
default:
Exceptions.printStackTrace(new IllegalStateException("Unexpected thread state: "+i+" of "+t));
return NbBundle.getMessage(DebuggingNodeModel.class, "CTL_Thread_State_Unknown", name);
}
*/
}
示例13: isGoToSourceSupported
import org.netbeans.api.debugger.jpda.JPDAThread; //导入方法依赖的package包/类
private static boolean isGoToSourceSupported (JPDAThread t) {
return t.isSuspended ();
}