/* (non-Javadoc)
@see com.ibm.ws.sib.processor.runtime.SIMPDeliveryStreamTransmitControllable#getNumberOfActiveMessages
430262
public int getNumberOfActiveMessages()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getNumberOfActiveMessages");
    int activeMessages = 
      (int)_sourceStream.countAllMessagesOnStream();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getNumberOfActiveMessages", new Integer(activeMessages));      
    return activeMessages;
  }
1339510
public SIMPIterator getReceivedMessageIterator(int maxMsgs)
  {
    List receivedMessages = new LinkedList();
    Iterator<MessageItem> streamMessages = 
      _targetStream.getAllMessagesOnStream().iterator();
    boolean allMsgs = (maxMsgs == SIMPConstants.SIMPCONTROL_RETURN_ALL_MESSAGES);
    int index = 0;
    while((allMsgs || (index < maxMsgs)) && streamMessages.hasNext())
    {
      MessageItem msgItem = (MessageItem)streamMessages.next();

      SIMPReceivedMessageControllable receivedMessage =
        new LinkReceivedMessageControl(msgItem, _tsm.getDestinationHandler().getMessageProcessor(), _tsm.getDestinationHandler());
      receivedMessages.add(receivedMessage);
      index++;
    }
    return new BasicSIMPIterator(receivedMessages.iterator());
  }
951144
public byte[] getMessage() {
        byte result[] = new byte[count * 2 + 4];

        int len = count * 2 + 2;
        result[0] = (byte)(len >> 8);
        result[1] = (byte)(len & 0xFF);
        result[2] = (byte)(count >> 8);
        result[3] = (byte)(count & 0xFF);

        for (int i = 0; i < count; i++) {
            byte value[] = registers[i].toBytes();
            result[i * 2 + 4] = value[0];
            result[i * 2 + 5] = value[1];
        }
        return result;
    }
226168
public long getNumberOfCompletedRequests()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getNumberOfCompletedRequests"); 
    long completedRequests = 
      getNumberOfRequestsReceived() - getNumberOfCurrentRequests();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getNumberOfCompletedRequests", new Long(completedRequests));
    return completedRequests; 
  }
880676
public long getNumberOfRequestsIssued()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getNumberOfRequestsIssued");
    long returnValue = anycastIH.getTotalSentRequests();   
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getNumberOfRequestsIssued", Long.valueOf(returnValue));     
    return returnValue;
  }
1284721
public int getMessageCount(E_MessageType type) {
		if(this.messageHandlers.containsKey(type)){
			return this.messageHandlers.get(type).getCount();
		}
		return -1;
	}
1162291
@Override
    public long getNumberOfMessagesReceived()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "getNumberOfMessagesReceived");
            SibTr.exit(tc, "getNumberOfMessagesReceived", Long.valueOf(numberOfMessagesReceived));
        }

        return numberOfMessagesReceived;
    }
159298
public int getActiveCount() {
        final ReentrantLock mainLock = this.mainLock;
        mainLock.lock();
        try {
            int n = 0;
            for (Worker w : workers)
                if (w.isLocked())
                    ++n;
            return n;
        } finally {
            mainLock.unlock();
        }
    }
93129
public long countAllMessagesOnStream()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "countAllMessagesOnStream");

    long count=0;
    _targetStream.setCursor(0);
    // Get the first TickRange
    TickRange tr = _targetStream.getNext();
    while (tr.endstamp < RangeList.INFINITY)
    {
      if (tr.type == TickRange.Value)
      {
        count++;
      }
      if (tr.type == TickRange.Requested)
      {
        // If we are an restarted IME (gathering) then we may have to restore msgs from the
        // DME which were previously Value msgs in this stream. We need to count any re-requests
        // in our count as they contribute to the total.
        if (((AIRequestedTick)tr.value).getRestoringAOValue() != null)
          count++;
      }
      tr = _targetStream.getNext();
    } // end while

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "countAllMessagesOnStream", Long.valueOf(count));
    return count;
  }
434093
public byte[] getMessage() {
        byte result[] = new byte[4];

        result[0] = (byte)(status >> 8);
        result[1] = (byte)(status & 0xFF);
        result[2] = (byte)(events >> 8);
        result[3] = (byte)(events & 0xFF);

        return result;
    }
1072693
@Override
    public String getGatherMessages() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getGatherMessages");

        String gatherMessages = (String) properties.get(GATHER_MESSAGES);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getGatherMessages");
        return gatherMessages;
    }
11231
public function getCurrentMessageCount()
    {
        // Save the current queue flags and setup the queue in passive mode
        $flags = $this->queue->getFlags();
        $this->queue->setFlags($flags | AMQP_PASSIVE);

        // Declare the queue again as passive to get the count of messages
        $messagesCount = $this->queue->declareQueue();

        // Restore the queue flags
        $this->queue->setFlags($flags);

        return $messagesCount;
    }
1187030
public SIMPIterator getTransmitMessagesIterator(int maxMsgs) throws SIMPControllableNotFoundException, SIMPRuntimeOperationFailedException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getTransmitMessagesIterator");

    assertValidControllable();

    SIMPIterator msgItr = null;
    try
    {
      msgItr = new SourceStreamSetXmitMessageIterator(maxMsgs);
    }
    catch (SIResourceException e)
    {
      FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.runtime.SourceStreamSetControl.getTransmitMessagesIterator",
          "1:283:1.39",
          this);

        SIMPRuntimeOperationFailedException finalE =
          new SIMPRuntimeOperationFailedException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0002",
              new Object[] {"SourceStreamSetControl.getTransmitMessagesIterator",
                  "1:291:1.39",
                            e},
              null), e);

        SibTr.exception(tc, finalE);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getTransmitMessagesIterator", finalE);
        throw finalE;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getTransmitMessagesIterator", msgItr);

    return msgItr;
  }
1107945
public byte[] getMessage() {
        byte result[] = new byte[events.length + 7];

        result[0] = (byte)(byteCount = events.length + 6);
        result[1] = (byte)(status >> 8);
        result[2] = (byte)(status & 0xFF);
        result[3] = (byte)(eventCount >> 8);
        result[4] = (byte)(eventCount & 0xFF);
        result[5] = (byte)(messageCount >> 8);
        result[6] = (byte)(messageCount & 0xFF);

        System.arraycopy(events, 0, result, 7, events.length);

        return result;
    }
611276
public void removeActiveMessages(int messages)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this,tc, "removeActiveMessages", new Object[] {Integer.valueOf(messages)});

    // If we're a member of a ConsumerSet, inform them of the remove
    if(classifyingMessages)
      consumerSet.removeActiveMessages(messages);

    if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(this,tc, "removeActiveMessages");
  }
63403
public SIMessageHandle getMessageHandle() {
        // If the transient is not set, build the handle from the values in the message and cache it.
        if (cachedMessageHandle == null) {
            byte[] b = (byte[]) jmo.getField(JsHdrAccess.SYSTEMMESSAGESOURCEUUID);
            if (b != null) {
                cachedMessageHandle = new JsMessageHandleImpl(new SIBUuid8(b), (Long) jmo.getField(JsHdrAccess.SYSTEMMESSAGEVALUE));
            }
            else {
                cachedMessageHandle = new JsMessageHandleImpl(null, (Long) jmo.getField(JsHdrAccess.SYSTEMMESSAGEVALUE));
            }
        }
        // Return the (possibly newly) cached value
        return cachedMessageHandle;
    }
171117
public static int getUnreadMessageCount() {
		try {
			if (ApptentiveInternal.isApptentiveRegistered()) {
				ConversationProxy conversationProxy = ApptentiveInternal.getInstance().getConversationProxy();
				return conversationProxy != null ? conversationProxy.getUnreadMessageCount() : 0;
			}
		} catch (Exception e) {
			ApptentiveLog.e(MESSAGES, e, "Exception while getting unread message count");
			logException(e);
		}
		return 0;
	}