docs: public void messagesAdded(int msgCount, BatchListener listener) throws SIResourceException
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(this, tc, "messagesAdded","msgCount="+msgCount+",listener="+listener);
  
      boolean completeBatch = false;
  
      try
      {
        synchronized(this) // lock the state against other readers
        {
          _currentBatchSize += msgCount;
  
          if((listener != null) && (!_listeners.contains(listener)))
          {
            // Remember that this listener needs calling when the batch completes
            _listeners.add(listener);
          }
  
          if(_currentBatchSize >= _batchSize) // Full batch, commit all updates
          {
            completeBatch = true;  // We can't do this under the synchronize as the exclusive lock
                                   // we need will deadlock with reader's trying to get this
          }                        // synchronize before these release their shared lock
          else if ((_currentBatchSize - msgCount) == 0) // New batch so ensure a timer is running
          {
            startTimer();
          }
        }
      }
      finally
      {
        _readWriteLock.unlock(); // release the read lock we took in registerInBatch
      }
  
      // Now we hold no locks we can try to complete he batch (this takes an exclusive lock
      if(completeBatch)
      {
        completeBatch(false);   // false = only complete a full batch
      }
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(this, tc, "messagesAdded");
    }