use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class HotSwapManager method reloadModifiedClasses.
public static void reloadModifiedClasses(final Map<DebuggerSession, Map<String, HotSwapFile>> modifiedClasses, final HotSwapProgress reloadClassesProgress) {
final MultiProcessCommand reloadClassesCommand = new MultiProcessCommand();
reloadClassesProgress.setCancelWorker(() -> reloadClassesCommand.cancel());
for (final DebuggerSession debuggerSession : modifiedClasses.keySet()) {
reloadClassesCommand.addCommand(debuggerSession.getProcess(), new DebuggerCommandImpl() {
protected void action() throws Exception {
reloadClassesProgress.setDebuggerSession(debuggerSession);
getInstance(reloadClassesProgress.getProject()).reloadClasses(debuggerSession, modifiedClasses.get(debuggerSession), reloadClassesProgress);
}
protected void commandCancelled() {
debuggerSession.setModifiedClassesScanRequired(true);
}
});
}
reloadClassesProgress.setTitle(DebuggerBundle.message("progress.hotswap.reloading"));
reloadClassesCommand.run();
}
use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class DebuggerTestCase method waitForCompleted.
protected void waitForCompleted() {
final SynchronizationBasedSemaphore s = new SynchronizationBasedSemaphore();
s.down();
final InvokeThread.WorkerThreadRequest request = getDebugProcess().getManagerThread().getCurrentRequest();
final Thread thread = new Thread("Joining " + request) {
@Override
public void run() {
try {
request.join();
} catch (Exception ignored) {
}
}
};
thread.start();
if (request.isDone()) {
thread.interrupt();
}
waitFor(() -> {
try {
thread.join();
} catch (InterruptedException ignored) {
}
});
invokeRatherLater(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
LOG.assertTrue(false);
}
@Override
protected void commandCancelled() {
//We wait for invokeRatherLater's
invokeRatherLater(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
LOG.assertTrue(false);
}
@Override
protected void commandCancelled() {
s.up();
}
});
}
});
waitFor(() -> s.waitFor());
}
use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class ExecutionWithDebuggerToolsTestCase method pumpSwingThread.
protected void pumpSwingThread() {
LOG.assertTrue(SwingUtilities.isEventDispatchThread());
final InvokeRatherLaterRequest request = myRatherLaterRequests.get(0);
request.invokesN++;
if (request.invokesN == RATHER_LATER_INVOKES_N) {
myRatherLaterRequests.remove(0);
if (!myRatherLaterRequests.isEmpty())
pumpSwingThread();
}
if (request.myDebuggerCommand instanceof SuspendContextCommandImpl) {
request.myDebugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(((SuspendContextCommandImpl) request.myDebuggerCommand).getSuspendContext()) {
@Override
public void contextAction() throws Exception {
pumpDebuggerThread(request);
}
@Override
protected void commandCancelled() {
pumpDebuggerThread(request);
}
});
} else {
request.myDebugProcess.getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
pumpDebuggerThread(request);
}
@Override
protected void commandCancelled() {
pumpDebuggerThread(request);
}
});
}
}
use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class ClassesFilteredView method setActive.
public void setActive(boolean active, @NotNull DebuggerManagerThreadImpl managerThread) {
if (myIsActive == active) {
return;
}
myIsActive = active;
managerThread.schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
if (active) {
doActivate();
} else {
doPause();
}
}
});
}
Aggregations