protected void notifyWaitingThread(RouteSpecificPool rospl){
  WaitingThread waitingThread=null;
  poolLock.lock();
  try {
    if ((rospl != null) && rospl.hasThread()) {
      if (log.isDebugEnabled()) {
        log.debug("Notifying thread waiting on pool" + " [" + rospl.getRoute() + "]");
      }
      waitingThread=rospl.nextThread();
    }
 else     if (!waitingThreads.isEmpty()) {
      if (log.isDebugEnabled()) {
        log.debug("Notifying thread waiting on any pool");
      }
      waitingThread=waitingThreads.remove();
    }
 else     if (log.isDebugEnabled()) {
      log.debug("Notifying no-one, there are no waiting threads");
    }
    if (waitingThread != null) {
      waitingThread.wakeup();
    }
  }
  finally {
    poolLock.unlock();
  }
}

protected void notifyWaitingThread ( RouteSpecificPool rospl ) { WaitingThread waitingThread = null ; poolLock . lock ( ) ; try { if ( ( rospl != null ) && rospl . hasThread ( ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Notifying thread waiting on pool" + " [" + rospl . getRoute ( ) + "]" ) ; } waitingThread = rospl . nextThread ( ) ; } else if ( ! waitingThreads . isEmpty ( ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Notifying thread waiting on any pool" ) ; } waitingThread = waitingThreads . remove ( ) ; } else if ( log . isDebugEnabled ( ) ) { log . debug ( "Notifying no-one, there are no waiting threads" ) ; } if ( waitingThread != null ) { waitingThread . wakeup ( ) ; } } finally { poolLock . unlock ( ) ; } }
notifies a waiting thread that a connection is available . this will wake a thread waiting in the specific route pool , if there is one . otherwise , a thread in the connection pool will be notified .
