@Override public void promptLoop(){
  lock.lock();
  try {
    while (true) {
      try {
        endOfShell.await();
      }
 catch (      InterruptedException e) {
      }
      this.exitShellRequest=ExitShellRequest.NORMAL_EXIT;
      setShellStatus(Status.SHUTTING_DOWN);
      break;
    }
  }
  finally {
    lock.unlock();
  }
}

@ Override public void promptLoop ( ) { lock . lock ( ) ; try { while ( true ) { try { endOfShell . await ( ) ; } catch ( InterruptedException e ) { } this . exitShellRequest = ExitShellRequest . NORMAL_EXIT ; setShellStatus ( Status . SHUTTING_DOWN ) ; break ; } } finally { lock . unlock ( ) ; } }
we override this method just to fool runner thread in reading from nothing . it waits for condition endofshell which is signalled when terminate is called . this achieves clean shutdown of runner thread .
