void (ExternalSystemTaskNotificationListener @NotNull ... listeners) { if (!compareAndSetState(ExternalSystemTaskState.NOT_STARTED, ExternalSystemTaskState.IN_PROGRESS)) return; ExternalSystemProgressNotificationManager progressManager = ExternalSystemProgressNotificationManager.getInstance(); for (ExternalSystemTaskNotificationListener listener : listeners) { progressManager.addNotificationListener(getId(), listener); } ExternalSystemProcessingManager processingManager = ApplicationManager.getApplication().getService(ExternalSystemProcessingManager.class); try { processingManager.add(this); doExecute(); setState(ExternalSystemTaskState.FINISHED); } catch (Exception e) { LOG.debug(e); myError.set(e); setState(ExternalSystemTaskState.FAILED); } catch (Throwable e) { LOG.error(e); myError.set(e); setState(ExternalSystemTaskState.FAILED); } finally { processingManager.release(getId()); } }