class TenantRepository {

    public void close() {
        directoryCache.ifPresent(Curator.DirectoryCache::close);
        try {
            zkCacheExecutor.shutdown();
            checkForRemovedApplicationsService.shutdown();
            zkWatcherExecutor.shutdownAndWait();
            zkCacheExecutor.awaitTermination(50, TimeUnit.SECONDS);
            checkForRemovedApplicationsService.awaitTermination(50, TimeUnit.SECONDS);
        }
        catch (InterruptedException e) {
            log.log(Level.WARNING, "Interrupted while shutting down.", e);
            Thread.currentThread().interrupt();
        }
    }

    @Inject public  TenantRepository(GlobalComponentRegistry componentRegistry);

}