use of com.intellij.javascript.karma.server.KarmaServerTerminatedListener in project intellij-plugins by JetBrains.
the class KarmaExecutionSession method terminateOnServerShutdown.
private static void terminateOnServerShutdown(@NotNull final KarmaServer server, @NotNull final ProcessHandler processHandler) {
final KarmaServerTerminatedListener terminationCallback = new KarmaServerTerminatedListener() {
@Override
public void onTerminated(int exitCode) {
processHandler.destroyProcess();
}
};
server.onTerminated(terminationCallback);
processHandler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
server.removeTerminatedListener(terminationCallback);
}
});
}
Aggregations