@Override public void expireReferences() { if (isExpirationRedundant()) { return; } if (!queueDestroyed && expiryScanner.scannerRunning.get() == 0) { expiryScanner.scannerRunning.incrementAndGet(); getExecutor().execute(expiryScanner); } }
@Override public void deliverAsync() { if (scheduledRunners.get() < MAX_SCHEDULED_RUNNERS) { scheduledRunners.incrementAndGet(); try { getExecutor().execute(deliverRunner); } catch (RejectedExecutionException ignored) { // no-op scheduledRunners.decrementAndGet(); } checkDepage(); } }
@Override public void close() throws Exception { getExecutor().execute(new Runnable() { @Override public void run() { try { cancelRedistributor(); } catch (Exception e) { // nothing that could be done anyway.. just logging ActiveMQServerLogger.LOGGER.unableToCancelRedistributor(e); } } }); if (addressSettingsRepository != null) { addressSettingsRepository.unRegisterListener(addressSettingsRepositoryListener); } }
private boolean internalFlushExecutor(long timeout, boolean log) { if (!getExecutor().flush(timeout, TimeUnit.MILLISECONDS)) { if (log) { ActiveMQServerLogger.LOGGER.queueBusy(this.name.toString(), timeout); } return false; } else { return true; } }
if (deliveriesInTransit.getCount() == 0 && getExecutor().isFlushed() && intermediateMessageReferences.isEmpty() && messageReferences.isEmpty() && !pageIterator.hasNext() && !pageSubscription.isPaging()) {
@Override public void unproposed(final SimpleString groupID) { if (groupID.toString().endsWith("." + this.getName())) { // this means this unproposed belongs to this routing, so we will // remove this group // This is removing the name and a . added, giving us the original groupID used // this is because a groupID is stored per queue, and only this queue is expiring at this point final SimpleString groupIDToRemove = (SimpleString) groupID.subSequence(0, groupID.length() - getName().length() - 1); // using an executor so we don't want to hold anyone just because of this getExecutor().execute(new Runnable() { @Override public void run() { synchronized (QueueImpl.this) { if (groups.remove(groupIDToRemove) != null) { logger.debug("Removing group after unproposal " + groupID + " from queue " + QueueImpl.this); } else { logger.debug("Couldn't remove Removing group " + groupIDToRemove + " after unproposal on queue " + QueueImpl.this); } } } }); } }
logger.debug("Breaking loop of expiring"); scannerRunning.incrementAndGet(); getExecutor().execute(this); break;