private void checkShutdown(){
synchronized (mux) {
    if (isBeingShutdown)     throw new RejectedExecutionException("Failed to execute command during executor shutdown.");
  }
}

private void checkShutdown ( ) { synchronized ( mux ) { if ( isBeingShutdown ) throw new RejectedExecutionException ( "Failed to execute command during executor shutdown." ) ; } }
checks if service is being shutdown .
