question: private HashSet doDisconnects ( boolean doReconnect , String reason ) { HashSet shutdownListeners = new HashSet ( ) ; for ( ; ; ) { DisconnectListener listener = null ; synchronized ( this . listeners ) { Iterator itr = listeners . iterator ( ) ; if ( ! itr . hasNext ( ) ) { break ; } listener = ( DisconnectListener ) itr . next ( ) ; if ( listener instanceof ShutdownListener ) { shutdownListeners . add ( listener ) ; } itr . remove ( ) ; } if ( doReconnect ) { runDisconnectForReconnect ( listener , disconnectListenerThreadGroup ) ; } else { runDisconnect ( listener , disconnectListenerThreadGroup ) ; } } return shutdownListeners ; }
target:  Disconnect cache, run disconnect listeners.