@Override
    public void close() {
        // disable submission of new tasks
        listeningExecutorService.shutdown();
        try {
            // wait for existing tasks to terminate
            if (!listeningExecutorService.awaitTermination(60, TimeUnit.SECONDS)) {
                // cancel any currently running executing tasks
                listeningExecutorService.shutdownNow();
                // wait for cancelled tasks to terminate
                if (!listeningExecutorService.awaitTermination(60, TimeUnit.SECONDS)) {
                    logger.error("some tasks did not terminate");
                }
            }
        } catch (InterruptedException e) {
            listeningExecutorService.shutdownNow();
            Thread.currentThread().interrupt();
        }
    }
@Override
    public void close() {
        
        listeningExecutorService.shutdown();
        try {
            
            if (!listeningExecutorService.awaitTermination(60, TimeUnit.SECONDS)) {
                
                listeningExecutorService.shutdownNow();
                
                if (!listeningExecutorService.awaitTermination(60, TimeUnit.SECONDS)) {
                    logger.error("some tasks did not terminate");
                }
            }
        } catch (InterruptedException e) {
            listeningExecutorService.shutdownNow();
            Thread.currentThread().interrupt();
        }
    }
@ Override public void close ( ) { // disable submission of new tasks listeningExecutorService . shutdown ( ) ; try { // wait for existing tasks to terminate if ( ! listeningExecutorService . awaitTermination ( 60 , TimeUnit . SECONDS ) ) { // cancel any currently running executing tasks listeningExecutorService . shutdownNow ( ) ; // wait for cancelled tasks to terminate if ( ! listeningExecutorService . awaitTermination ( 60 , TimeUnit . SECONDS ) ) { logger . error ( "some tasks did not terminate" ) ; } } } catch ( InterruptedException e ) { listeningExecutorService . shutdownNow ( ) ; Thread . currentThread ( ) . interrupt ( ) ; } }
Releases any internal resources.
It is responsibility of the caller to close {@link DocumentClient}.
Releases any internal resources . It is responsibility of the caller to close {