public void quiesce(long timeout){
  final String methodName="quiesce";
  if (timeout > 0) {
    log.fine(CLASS_NAME,methodName,"637",new Object[]{new Long(timeout)});
synchronized (queueLock) {
      this.quiescing=true;
    }
    callback.quiesce();
    notifyQueueLock();
synchronized (quiesceLock) {
      try {
        int tokc=tokenStore.count();
        if (tokc > 0 || pendingFlows.size() > 0 || !callback.isQuiesced()) {
          log.fine(CLASS_NAME,methodName,"639",new Object[]{new Integer(actualInFlight),new Integer(pendingFlows.size()),new Integer(inFlightPubRels),new Integer(tokc)});
          quiesceLock.wait(timeout);
        }
      }
 catch (      InterruptedException ex) {
      }
    }
synchronized (queueLock) {
      pendingMessages.clear();
      pendingFlows.clear();
      quiescing=false;
      actualInFlight=0;
    }
    log.fine(CLASS_NAME,methodName,"640");
  }
}

public void quiesce ( long timeout ) { final String methodName = "quiesce" ; if ( timeout > 0 ) { log . fine ( CLASS_NAME , methodName , "637" , new Object [ ] { new Long ( timeout ) } ) ; synchronized ( queueLock ) { this . quiescing = true ; } callback . quiesce ( ) ; notifyQueueLock ( ) ; synchronized ( quiesceLock ) { try { int tokc = tokenStore . count ( ) ; if ( tokc > 0 || pendingFlows . size ( ) > 0 || ! callback . isQuiesced ( ) ) { log . fine ( CLASS_NAME , methodName , "639" , new Object [ ] { new Integer ( actualInFlight ) , new Integer ( pendingFlows . size ( ) ) , new Integer ( inFlightPubRels ) , new Integer ( tokc ) } ) ; quiesceLock . wait ( timeout ) ; } } catch ( InterruptedException ex ) { } } synchronized ( queueLock ) { pendingMessages . clear ( ) ; pendingFlows . clear ( ) ; quiescing = false ; actualInFlight = 0 ; } log . fine ( CLASS_NAME , methodName , "640" ) ; } }
quiesce the client state , preventing any new messages getting sent , and preventing the callback on any newly received messages . after the timeout expires , delete any pending messages except for outbound acks , and wait for those acks to complete .
