org.apache.activemq.command.Message.decrementReferenceCount()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中org.apache.activemq.command.Message.decrementReferenceCount()方法的一些代码示例,展示了Message.decrementReferenceCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.decrementReferenceCount()方法的具体详情如下:
包路径:org.apache.activemq.command.Message
类名称:Message
方法名:decrementReferenceCount

Message.decrementReferenceCount介绍

暂无

代码示例

代码示例来源:origin: apache/activemq

@Override
  public void afterRollback() throws Exception {
    message.decrementReferenceCount();
  }
});

代码示例来源:origin: apache/activemq

@Override
public synchronized void drop() {
  dropped = true;
  lockOwner = null;
  message.decrementReferenceCount();
}

代码示例来源:origin: apache/activemq

@Override
public int decrementReferenceCount() {
  return message.decrementReferenceCount();
}

代码示例来源:origin: apache/activemq

public void afterRollback() throws Exception {
    if (debug) {
      LOG.debug("Transacted message add rollback for: " + id + ", at: " + location);
    }
    synchronized (JournalMessageStore.this) {
      inFlightTxLocations.remove(location);
    }
    message.decrementReferenceCount();
  }
});

代码示例来源:origin: apache/activemq

@Override
  protected void onCacheEviction(Map.Entry<MessageId, Message> eldest) {
    decMessageStoreStatistics(messageStoreStatistics, eldest.getValue());
    // We aren't tracking this anymore so remove our reference to it.
    eldest.getValue().decrementReferenceCount();
  }
}

代码示例来源:origin: apache/activemq

@Override
public void releaseLocks() {
  if (this.locked.compareAndSet(true, false)) {
    store.releaseLocalAsyncLock();
    globalQueueSemaphore.release();
    message.decrementReferenceCount();
  }
}

代码示例来源:origin: apache/activemq

final void removeMessage(final MessageAck ack, final RecordLocation location) {
  synchronized (this) {
    lastLocation = location;
    MessageId id = ack.getLastMessageId();
    Message message = messages.remove(id);
    if (message == null) {
      messageAcks.add(ack);
    } else {
      message.decrementReferenceCount();
    }
  }
}

代码示例来源:origin: apache/activemq

@Override
public void releaseLocks() {
  if (this.locked.compareAndSet(true, false)) {
    message.decrementReferenceCount();
    store.releaseLocalAsyncLock();
    globalTopicSemaphore.release();
  }
}

代码示例来源:origin: apache/activemq

void removeMessage(MessageId id) {
  Message removed;
  synchronized (this) {
    removed = map.remove(id);
    if ((lastBatch != null && lastBatch.equals(id)) || map.isEmpty()) {
      resetBatching();
    }
  }
  if (removed != null) {
    removed.decrementReferenceCount();
  }
}

代码示例来源:origin: apache/activemq

public void removeMessage(MessageId msgId) throws IOException {
  synchronized (messageTable) {
    Message removed = messageTable.remove(msgId);
    if (removed != null) {
      removed.decrementReferenceCount();
      decMessageStoreStatistics(getMessageStoreStatistics(), removed);
    }
    if ((lastBatchId != null && lastBatchId.equals(msgId)) || messageTable.isEmpty()) {
      lastBatchId = null;
    }
  }
}

代码示例来源:origin: apache/activemq

@Override
public void afterCommit() throws Exception {
  if (store != null && messageContext.message.isPersistent()) {
    doPendingCursorAdditions();
  } else {
    cursorAdd(messageContext.message);
    messageSent(messageContext.context, messageContext.message);
  }
  messageContext.message.decrementReferenceCount();
}

代码示例来源:origin: apache/activemq

@Override
  public void afterRollback() throws Exception {
    if (store != null && messageContext.message.isPersistent()) {
      rollbackPendingCursorAdditions(messageContext.message.getMessageId());
    }
    messageContext.message.decrementReferenceCount();
  }
}

代码示例来源:origin: apache/activemq

@Override
public void afterCommit() throws Exception {
  // It could take while before we receive the commit
  // operation.. by that time the message could have
  // expired..
  if (message.isExpired()) {
    if (broker.isExpired(message)) {
      getDestinationStatistics().getExpired().increment();
      broker.messageExpired(context, message, null);
    }
    message.decrementReferenceCount();
    return;
  }
  try {
    dispatch(context, message);
  } finally {
    message.decrementReferenceCount();
  }
}

代码示例来源:origin: apache/activemq

message.decrementReferenceCount();

代码示例来源:origin: apache/activemq

dispatch(context, message);
} finally {
  message.decrementReferenceCount();

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
  protected void onCacheEviction(Map.Entry<MessageId, Message> eldest) {
    decMessageStoreStatistics(messageStoreStatistics, eldest.getValue());
    // We aren't tracking this anymore so remove our reference to it.
    eldest.getValue().decrementReferenceCount();
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public void releaseLocks() {
  if (this.locked.compareAndSet(true, false)) {
    message.decrementReferenceCount();
    store.releaseLocalAsyncLock();
    globalTopicSemaphore.release();
  }
}

代码示例来源:origin: org.apache.activemq/activemq-kahadb-store

@Override
public void releaseLocks() {
  if (this.locked.compareAndSet(true, false)) {
    store.releaseLocalAsyncLock();
    globalQueueSemaphore.release();
    message.decrementReferenceCount();
  }
}

代码示例来源:origin: org.apache.activemq/activemq-broker

void removeMessage(MessageId id) {
  Message removed;
  synchronized (this) {
    removed = map.remove(id);
    if ((lastBatch != null && lastBatch.equals(id)) || map.isEmpty()) {
      resetBatching();
    }
  }
  if (removed != null) {
    removed.decrementReferenceCount();
  }
}

代码示例来源:origin: org.apache.activemq/activemq-broker

public void removeMessage(MessageId msgId) throws IOException {
  synchronized (messageTable) {
    Message removed = messageTable.remove(msgId);
    if (removed != null) {
      removed.decrementReferenceCount();
      decMessageStoreStatistics(getMessageStoreStatistics(), removed);
    }
    if ((lastBatchId != null && lastBatchId.equals(msgId)) || messageTable.isEmpty()) {
      lastBatchId = null;
    }
  }
}

相关文章

Message类方法