docs: public TransmissionData dequeue()
     throws SIConnectionDroppedException
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dequeue");
  
        TransmissionData retValue = null;
  
        Queue queue = null;
        synchronized(queueMonitor)
        {
           if (state == CLOSED)
           {
              throw new SIConnectionDroppedException(TraceNLS.getFormattedMessage(JFapChannelConstants.MSG_BUNDLE, "PRIORITY_QUEUE_PURGED_SICJ0077", null, "PRIORITY_QUEUE_PURGED_SICJ0077"));
           }
           else
           {
              // Find the highest non-empty priority
              int priority = JFapChannelConstants.MAX_PRIORITY_LEVELS-1;
              while((priority >= 0) && (queueArray[priority].depth == 0)) --priority;
  
              if (priority >= 0)
              {
                 queue = queueArray[priority];
  
                 // Dequeue the data and update the queue appropriately.
                 TransmissionDataIterator iterator = queue.head();               // D217401
                 retValue = iterator.next();
  
                 queue.bytes -= retValue.getSize();
  
                 // If there is no more data left to iterate over then remove the
                 // transmission data from the queue and update the depth counters.
                 if (!iterator.hasNext())
                 {
                    queue.dequeue();                                      // D217401
                    --queue.depth;
                    --totalQueueDepth;
                 }
  
                 // If the priority queue is in closing state and we have just emptied
                 // the queue, mark the queue as closed and unblock anyone waiting for the
                 // queue to close.
                 if ((totalQueueDepth == 0) && (state == CLOSING))
                 {
                    state = CLOSED;                           // Transition to the close state
                    closeWaitersMonitor.setActive(false);     // Unblock anyone waiting for the close
  
                    // Un-block any queue monitors, in case other threads are blocked waiting
                    // to try and queue data.
                    for (int i=0; i < JFapChannelConstants.MAX_PRIORITY_LEVELS; ++i)
                       queueArray[i].monitor.setActive(false);
                 }
  
                 // If dequeueing the data caused a change in capacity then
                 // take the appropriate actions
                 if (!queue.hasCapacity &&
                     (queue.bytes < maxQueueBytes) &&
                     queue.depth < maxQueueDepth)
                 {
                    // Mark the queue as having capacity
                    queue.hasCapacity = true;
  
                    // If the change in capacity results in more priority levels having capacity then...
                    if (priority < lowestPriorityWithCapacity)
                    {
                       // Unblock any threads waiting on the lower capacity levels
                       int newLowestPriorityWithCapacity = priority;
                       while((newLowestPriorityWithCapacity > 0) &&
                             queueArray[newLowestPriorityWithCapacity-1].hasCapacity)
                       {
                          queueArray[newLowestPriorityWithCapacity].monitor.setActive(false);
                          --newLowestPriorityWithCapacity;
                       }
                       lowestPriorityWithCapacity = newLowestPriorityWithCapacity;
                       queueArray[lowestPriorityWithCapacity].monitor.setActive(false);
                    }
                 }
              }
           }
        }
  
        if (retValue != null)
        {
           if (type == Conversation.CLIENT)
              clientQueuedBytes -= retValue.getSize();
           else
              meQueuedBytes -= retValue.getSize();
        }
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dequeue", retValue);
        return retValue;
     }