question: private synchronized void checkShutDownProxyBridge ( ) { if ( proxyServer != null ) { smtpRequestsPhaser . arriveAndDeregister ( ) ; LOGGER . trace ( "SMTP request threads left: {}" , smtpRequestsPhaser . getUnarrivedParties ( ) ) ; if ( smtpRequestsPhaser . getUnarrivedParties ( ) == 0 ) { LOGGER . trace ( "all threads have finished processing" ) ; if ( proxyServer . isRunning ( ) && ! proxyServer . isStopping ( ) ) { LOGGER . trace ( "stopping proxy bridge..." ) ; proxyServer . stop ( ) ; } if ( executor != null ) { executor . shutdown ( ) ; } } } }
target:  We need to keep a count of running threads only if we need to shutdown the proxy bridging server at the end in async mode. <p> ProxyServer != null means we need to shut down server, registered parties means we're running in async (batch) mode