@Override
    public void close() throws InterruptedException {
        if (m_blessedThreadIds.contains(Thread.currentThread().getId())) {
            throw new RuntimeException("Can't invoke backpressureBarrier from within the client callback thread " +
                    " without deadlocking the client library");
        }
        m_isShutdown = true;
        synchronized (m_backpressureLock) {
            m_backpressureLock.notifyAll();
        }

        if (m_reconnectStatusListener != null) {
            m_distributer.removeClientStatusListener(m_reconnectStatusListener);
            m_reconnectStatusListener.close();
        }

        if (m_ex != null) {
            m_ex.shutdown();
            if (CoreUtils.isJunitTest()) {
                m_ex.awaitTermination(1, TimeUnit.SECONDS);
            } else {
                m_ex.awaitTermination(365, TimeUnit.DAYS);
            }
        }
        m_distributer.shutdown();
        ClientFactory.decreaseClientNum();
    }
@ Override public void close ( ) throws InterruptedException { if ( m_blessedThreadIds . contains ( Thread . currentThread ( ) . getId ( ) ) ) { throw new RuntimeException ( "Can't invoke backpressureBarrier from within the client callback thread " + " without deadlocking the client library" ) ; } m_isShutdown = true ; synchronized ( m_backpressureLock ) { m_backpressureLock . notifyAll ( ) ; } if ( m_reconnectStatusListener != null ) { m_distributer . removeClientStatusListener ( m_reconnectStatusListener ) ; m_reconnectStatusListener . close ( ) ; } if ( m_ex != null ) { m_ex . shutdown ( ) ; if ( CoreUtils . isJunitTest ( ) ) { m_ex . awaitTermination ( 1 , TimeUnit . SECONDS ) ; } else { m_ex . awaitTermination ( 365 , TimeUnit . DAYS ) ; } } m_distributer . shutdown ( ) ; ClientFactory . decreaseClientNum ( ) ; }
Shutdown the client closing all network connections and release
all memory resources.
@throws InterruptedException