本文整理汇总了Java中org.netbeans.api.debugger.jpda.JPDADebugger.getState方法的典型用法代码示例。如果您正苦于以下问题:Java JPDADebugger.getState方法的具体用法?Java JPDADebugger.getState怎么用?Java JPDADebugger.getState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.debugger.jpda.JPDADebugger
的用法示例。
在下文中一共展示了JPDADebugger.getState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSessionState
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
private String getSessionState (Session s) {
DebuggerEngine e = s.getCurrentEngine ();
if (e == null)
return loc ("MSG_Session_State_Starting");
JPDADebugger d = e.lookupFirst(null, JPDADebugger.class);
synchronized (this) {
if (!addedAsListener) {
d.addPropertyChangeListener (JPDADebugger.PROP_STATE, this);
}
}
switch (d.getState ()) {
case JPDADebugger.STATE_DISCONNECTED:
return loc ("MSG_Session_State_Disconnected");
case JPDADebugger.STATE_RUNNING:
return loc ("MSG_Session_State_Running");
case JPDADebugger.STATE_STARTING:
return loc ("MSG_Session_State_Starting");
case JPDADebugger.STATE_STOPPED:
return loc ("MSG_Session_State_Stopped");
}
return null;
}
示例2: getThreadsState
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的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();
}
}
示例3: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (JPDADebugger.PROP_STATE.equals(evt.getPropertyName())) {
JPDADebugger d = (JPDADebugger) evt.getSource();
if (JPDADebugger.STATE_DISCONNECTED == d.getState()) {
d.removePropertyChangeListener(this);
synchronized (remoteServiceClasses) {
remoteServiceClasses.remove(d);
}
}
}
}
示例4: propertyChange
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
JPDADebugger deb = (JPDADebugger)evt.getSource();
if (deb != null && deb.getState() == JPDADebugger.STATE_DISCONNECTED) {
deb.removePropertyChangeListener(this);
stop();
}
}
示例5: run
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
public void run() {
LOG.log(Level.FINE, "Tick at {0}", System.currentTimeMillis());
Session session = refSession.get();
if (stop || session == null) {
stop();
return;
}
JPDADebugger debugger = session.lookupFirst(null, JPDADebugger.class);
if (debugger == null) {
stop();
return;
}
debugger.addPropertyChangeListener(JPDADebugger.PROP_STATE, this);
if (debugger.getState() == JPDADebugger.STATE_DISCONNECTED) {
LOG.log(Level.FINE, "debugge has disconnected: {0}", session);
stop();
return;
}
try {
if (probeCounter == 0) {
waitVirtualMachine(debugger, session);
} else if (probeCounter >= MAX_PROBE_COUNTER) {
LOG.log(Level.FINE, "Max probe count reached for debugger session {0}", session);
stop();
return;
}
if (probe(debugger, session)) {
RP.schedule(this, DEBUGGER_PROBE_DELAY, TimeUnit.MILLISECONDS);
probeCounter++;
}
} catch (DebuggerStartException ex) {
// the debugger fails to start, terminate the connection
LOG.log(Level.FINE, "Exception during debugger start: {0}", ex);
stop();
}
}
示例6: annotate
import org.netbeans.api.debugger.jpda.JPDADebugger; //导入方法依赖的package包/类
/**
* Annotates current thread or removes annotations.
*/
private void annotate () {
// 1) no current thread => remove annotations
final JPDADebugger debugger;
final SourcePath sourcePath;
final JPDAThread thread;
synchronized (this) {
debugger = currentDebugger;
if ( (currentThread == null) ||
(debugger.getState () != JPDADebugger.STATE_STOPPED) ) {
synchronized (currentPCLock) {
currentPCSet = false; // The annotation is goint to be removed
}
removeAnnotations ();
return;
}
sourcePath = currentSourcePath;
thread = currentThread;
}
Session s;
try {
s = (Session) debugger.getClass().getMethod("getSession").invoke(debugger);
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
s = null;
}
RequestProcessor rProcessor = null;
if (s != null) {
rProcessor = s.lookupFirst(null, RequestProcessor.class);
}
if (rProcessor == null) {
rProcessor = this.rp;
}
rProcessor.post(new Runnable() {
@Override
public void run() {
annotate(debugger, thread, sourcePath);
}
});
}