public void pause ( ServerActivityCallback requestCountListener ) { if ( paused ) { throw ServerLogger . ROOT_LOGGER . serverAlreadyPaused ( ) ; } this . paused = true ; listenerUpdater . set ( this , requestCountListener ) ; if ( activeRequestCountUpdater . get ( this ) == 0 ) { if ( listenerUpdater . compareAndSet ( this , requestCountListener , null ) ) { requestCountListener . done ( ) ; } } }
Pause the current entry point and invoke the provided listener when all current requests have finished .