Search in sources :

Example 1 with KarmaServerTerminatedListener

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);
        }
    });
}
Also used : KarmaServerTerminatedListener(com.intellij.javascript.karma.server.KarmaServerTerminatedListener)

Aggregations

KarmaServerTerminatedListener (com.intellij.javascript.karma.server.KarmaServerTerminatedListener)1