Search in sources :

Example 1 with DeferredCloser

use of org.cryptomator.ui.util.DeferredCloser in project cryptomator by cryptomator.

the class CryptomatorModule method provideDeferredCloser.

@Provides
@Singleton
DeferredCloser provideDeferredCloser() {
    DeferredCloser closer = new DeferredCloser();
    Cryptomator.addShutdownTask(() -> {
        try {
            closer.close();
        } catch (Exception e) {
            LOG.error("Error during shutdown.", e);
        }
    });
    return closer;
}
Also used : DeferredCloser(org.cryptomator.ui.util.DeferredCloser) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Aggregations

Provides (dagger.Provides)1 Singleton (javax.inject.Singleton)1 DeferredCloser (org.cryptomator.ui.util.DeferredCloser)1