private boolean dequeueTransmissionData(WsByteBuffer bufferToFill) throws SIConnectionDroppedException {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dequeueTransmissionData", bufferToFill);

      boolean exhaustedTransmissionsToSend = false;
      boolean dataCopied = false;
      boolean isTerminal = false;
      TransmissionData data;
      synchronized (this) {
         data = partiallySentTransmission;
      }
      try {
         do {
            if (data == null) {
               synchronized (priorityQueue) {
                  data = priorityQueue.dequeue();
               }
            }

            if (data == null) {
               exhaustedTransmissionsToSend = true;
            } else {
               boolean finishedThisTransmission = data.buildTransmission(bufferToFill);
               dataCopied = true;

               if (finishedThisTransmission) {
                  final SendListener sendListener = data.getSendListener();
                  if (sendListener != null) {
                     sendCallbacks.add(new Pair<SendListener, Conversation>(sendListener, data.getConversation()));
                  }
                  //Is this transmission the last one that should be sent over this connection?
                  isTerminal = data.isTerminal();
                  data.release();                           // D226242
                  data = null;
               }
            }
         } while (!exhaustedTransmissionsToSend && !isTerminal && (bufferToFill.remaining() > 0));
      } finally {
         synchronized (this) {
            partiallySentTransmission = data;
            terminate = isTerminal;
         }
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dequeueTransmissionData", Boolean.valueOf(dataCopied));
      return dataCopied;
   }
private boolean dequeueTransmissionData ( WsByteBuffer bufferToFill ) throws SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dequeueTransmissionData" , bufferToFill ) ; boolean exhaustedTransmissionsToSend = false ; boolean dataCopied = false ; boolean isTerminal = false ; TransmissionData data ; synchronized ( this ) { data = partiallySentTransmission ; } try { do { if ( data == null ) { synchronized ( priorityQueue ) { data = priorityQueue . dequeue ( ) ; } } if ( data == null ) { exhaustedTransmissionsToSend = true ; } else { boolean finishedThisTransmission = data . buildTransmission ( bufferToFill ) ; dataCopied = true ; if ( finishedThisTransmission ) { final SendListener sendListener = data . getSendListener ( ) ; if ( sendListener != null ) { sendCallbacks . add ( new Pair < SendListener , Conversation > ( sendListener , data . getConversation ( ) ) ) ; } isTerminal = data . isTerminal ( ) ; data . release ( ) ; data = null ; } } } while ( ! exhaustedTransmissionsToSend && ! isTerminal && ( bufferToFill . remaining ( ) > 0 ) ) ; } finally { synchronized ( this ) { partiallySentTransmission = data ; terminate = isTerminal ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dequeueTransmissionData" , Boolean . valueOf ( dataCopied ) ) ; return dataCopied ; }
Copies the next "chunk" of transmission data to send into the supplied
buffer.  This method attempts to write as much transmission data as possible
into the buffer supplied as an argument.  It may place multiple transmissions
into the buffer and tracks what transmissions are "in flight" as well as what
transmission (if any) has been partially sent.
@param bufferToFill Buffer to fill with transmission data.
@return boolean True iff some data was copied.  False if no data was available to
be copied.