ProcessListener () { return new ProcessListener() { @Override public void startNotified(@NotNull ProcessEvent event) { for (ProcessListener listener : myListeners) { try { listener.startNotified(event); } catch (ProcessCanceledException e) { LOG.info(e); } catch (Throwable e) { LOG.error(e); } } } @Override public void processTerminated(@NotNull ProcessEvent event) { for (ProcessListener listener : myListeners) { try { listener.processTerminated(event); } catch (ProcessCanceledException e) { LOG.info(e); } catch (Throwable e) { LOG.error(e); } } } @Override public void processWillTerminate(@NotNull ProcessEvent event, boolean willBeDestroyed) { for (ProcessListener listener : myListeners) { try { listener.processWillTerminate(event, willBeDestroyed); } catch (ProcessCanceledException e) { LOG.info(e); } catch (Throwable e) { LOG.error(e); } } } @Override public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) { for (ProcessListener listener : myListeners) { try { listener.onTextAvailable(event, outputType); } catch (ProcessCanceledException e) { LOG.info(e); } catch (Throwable e) { LOG.error(e); } } } }; }