public void add(long amount) { if (isEnabled()) { counter.addAndGet(amount); updateSampleTime(); if (parent != null) { parent.add(amount); } } }
/** * Updates the counts in RegionStatistics based on whether or not the destination * is an Advisory Destination or not * * @param destination the destination being used to determine which counters to update * @param count the count to add to the counters */ protected void updateRegionDestCounts(ActiveMQDestination destination, int count) { if (destination != null) { if (AdvisorySupport.isAdvisoryTopic(destination)) { regionStatistics.getAdvisoryDestinations().add(count); } else { regionStatistics.getDestinations().add(count); } regionStatistics.getAllDestinations().add(count); } }
@Override public void afterCommit() throws Exception { Destination dest = transactionBroker.addDestination(transactionBroker.context, destination, false); if (messageSend) { dest.clearPendingMessages(opCount); dest.getDestinationStatistics().getEnqueues().add(opCount); dest.getDestinationStatistics().getMessages().add(opCount); LOG.debug("cleared pending from afterCommit: {}", destination); } else { dest.getDestinationStatistics().getDequeues().add(opCount); } } }
@Override public void afterRollback() throws Exception { if (!messageSend) { Destination dest = transactionBroker.addDestination(transactionBroker.context, destination, false); dest.clearPendingMessages(opCount); dest.getDestinationStatistics().getMessages().add(opCount); LOG.debug("cleared pending from afterRollback: {}", destination); } }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }
@Override protected void acknowledge(ConnectionContext context, MessageAck ack, MessageReference node) throws IOException { this.setTimeOfLastMessageAck(System.currentTimeMillis()); Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.acknowledge(context, this, ack, node); redeliveredMessages.remove(node.getMessageId()); node.decrementReferenceCount(); ((Destination)node.getRegionDestination()).getDestinationStatistics().getDequeues().increment(); if (info.isNetworkSubscription()) { ((Destination)node.getRegionDestination()).getDestinationStatistics().getForwards().add(ack.getMessageCount()); } }
@Override public void add(ConnectionContext context, Destination destination) throws Exception { if (!destinations.contains(destination)) { super.add(context, destination); } // do it just once per destination if (durableDestinations.containsKey(destination.getActiveMQDestination())) { return; } durableDestinations.put(destination.getActiveMQDestination(), destination); if (active.get() || keepDurableSubsActive) { Topic topic = (Topic) destination; topic.activate(context, this); getSubscriptionStatistics().getEnqueues().add(pending.size()); } else if (destination.getMessageStore() != null) { TopicMessageStore store = (TopicMessageStore) destination.getMessageStore(); try { getSubscriptionStatistics().getEnqueues().add(store.getMessageCount(subscriptionKey.getClientId(), subscriptionKey.getSubscriptionName())); } catch (IOException e) { JMSException jmsEx = new JMSException("Failed to retrieve enqueueCount from store " + e); jmsEx.setLinkedException(e); throw jmsEx; } } dispatchPending(); }
} while (!listener.done()); } else { destinationStatistics.getMessages().add(messageCount);
public void add(long amount) { if (isEnabled()) { counter.addAndGet(amount); updateSampleTime(); if (parent != null) { parent.add(amount); } } }
public void add(long amount) { if (isEnabled()) { counter.addAndGet(amount); updateSampleTime(); if (parent != null) { parent.add(amount); } } }
public void add(long amount) { if (isEnabled()) { counter.addAndGet(amount); updateSampleTime(); if (parent != null) { parent.add(amount); } } }
public void add(long amount) { if (isEnabled()) { counter.addAndGet(amount); updateSampleTime(); if (parent != null) { parent.add(amount); } } }
@Override public void afterCommit() throws Exception { if (messageSend) { destination.clearPendingMessages(); destination.getDestinationStatistics().getEnqueues().add(opCount); destination.getDestinationStatistics().getMessages().add(opCount); LOG.debug("cleared pending from afterCommit: {}", destination); } else { destination.getDestinationStatistics().getDequeues().add(opCount); destination.getDestinationStatistics().getMessages().subtract(opCount); } } }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }
@Override public void afterCommit() throws Exception { if (messageSend) { destination.clearPendingMessages(); destination.getDestinationStatistics().getEnqueues().add(opCount); destination.getDestinationStatistics().getMessages().add(opCount); LOG.debug("cleared pending from afterCommit: {}", destination); } else { destination.getDestinationStatistics().getDequeues().add(opCount); destination.getDestinationStatistics().getMessages().subtract(opCount); } } }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }
@Override protected void acknowledge(ConnectionContext context, MessageAck ack, MessageReference node) throws IOException { this.setTimeOfLastMessageAck(System.currentTimeMillis()); Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.acknowledge(context, this, ack, node); redeliveredMessages.remove(node.getMessageId()); node.decrementReferenceCount(); ((Destination)node.getRegionDestination()).getDestinationStatistics().getDequeues().increment(); if (info.isNetworkSubscription()) { ((Destination)node.getRegionDestination()).getDestinationStatistics().getForwards().add(ack.getMessageCount()); } }
@Override protected void acknowledge(ConnectionContext context, MessageAck ack, MessageReference node) throws IOException { this.setTimeOfLastMessageAck(System.currentTimeMillis()); Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.acknowledge(context, this, ack, node); redeliveredMessages.remove(node.getMessageId()); node.decrementReferenceCount(); ((Destination)node.getRegionDestination()).getDestinationStatistics().getDequeues().increment(); if (info.isNetworkSubscription()) { ((Destination)node.getRegionDestination()).getDestinationStatistics().getForwards().add(ack.getMessageCount()); } }
@Override protected void acknowledge(ConnectionContext context, MessageAck ack, MessageReference node) throws IOException { this.setTimeOfLastMessageAck(System.currentTimeMillis()); Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.acknowledge(context, this, ack, node); redeliveredMessages.remove(node.getMessageId()); node.decrementReferenceCount(); ((Destination)node.getRegionDestination()).getDestinationStatistics().getDequeues().increment(); if (info.isNetworkSubscription()) { ((Destination)node.getRegionDestination()).getDestinationStatistics().getForwards().add(ack.getMessageCount()); } }