private void checkForTermination ( ) { synchronized ( lock ) { if ( shutdown && transports . isEmpty ( ) && transportServersTerminated ) { if ( terminated ) { throw new AssertionError ( "Server already terminated" ) ; } terminated = true ; channelz . removeServer ( this ) ; if ( executor != null ) { executor = executorPool . returnObject ( executor ) ; } lock . notifyAll ( ) ; } } }
Notify of complete shutdown if necessary .