Пример #1
0
  public void dispose() {
    fireApplicationExiting();
    disposeComponents();

    ourThreadExecutorsService.shutdownNow();
    super.dispose();
  }
  public void dispose() {
    fireApplicationExiting();

    ShutDownTracker.getInstance().ensureStopperThreadsFinished();

    disposeComponents();

    ourThreadExecutorsService.shutdownNow();
    myComponentStore = null;
    super.dispose();
    Disposer.dispose(myLastDisposable); // dispose it last
  }
Пример #3
0
 public Future<?> executeOnPooledThread(@NotNull final Runnable action) {
   return ourThreadExecutorsService.submit(
       new Runnable() {
         public void run() {
           try {
             action.run();
           } catch (ProcessCanceledException e) {
             // ignore
           } catch (Throwable t) {
             LOG.error(t);
           } finally {
             Thread.interrupted(); // reset interrupted status
           }
         }
       });
 }
Пример #4
0
 @Override
 public <T> Future<T> executeOnPooledThread(@NotNull final Callable<T> action) {
   return ourThreadExecutorsService.submit(
       new Callable<T>() {
         public T call() {
           try {
             return action.call();
           } catch (ProcessCanceledException e) {
             // ignore
           } catch (Throwable t) {
             LOG.error(t);
           } finally {
             Thread.interrupted(); // reset interrupted status
           }
           return null;
         }
       });
 }