private void waitForOnMessageToComplete(boolean waitForOnMessage) { if (handler == null) { return; } if (!waitForOnMessage || Thread.currentThread() == onMessageThread) { // If called from inside onMessage then return immediately - otherwise would block return; } FutureLatch future = new FutureLatch(); sessionExecutor.execute(future); boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); if (!ok) { ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing(); } }
@Override public void flushExecutor() { // Wait for any create objects runnable to complete FutureLatch future = new FutureLatch(); executor.execute(future); boolean ok = future.await(10000); if (!ok) { ActiveMQServerLogger.LOGGER.timedOutWaitingToStopBridge(); } }
private void waitForOnMessageToComplete(boolean waitForOnMessage) { if (handler == null) { return; } if (!waitForOnMessage || Thread.currentThread() == onMessageThread) { // If called from inside onMessage then return immediately - otherwise would block return; } FutureLatch future = new FutureLatch(); sessionExecutor.execute(future); boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); if (!ok) { ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing(); } }
private void waitForOnMessageToComplete(boolean waitForOnMessage) { if (handler == null) { return; } if (!waitForOnMessage || Thread.currentThread() == onMessageThread) { // If called from inside onMessage then return immediately - otherwise would block return; } FutureLatch future = new FutureLatch(); sessionExecutor.execute(future); boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); if (!ok) { ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing(); } }
private void waitForOnMessageToComplete(boolean waitForOnMessage) { if (handler == null) { return; } if (!waitForOnMessage || Thread.currentThread() == onMessageThread) { // If called from inside onMessage then return immediately - otherwise would block return; } FutureLatch future = new FutureLatch(); sessionExecutor.execute(future); boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); if (!ok) { ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing(); } }
private void waitForOnMessageToComplete(boolean waitForOnMessage) { if (handler == null) { return; } if (!waitForOnMessage || Thread.currentThread() == onMessageThread) { // If called from inside onMessage then return immediately - otherwise would block return; } FutureLatch future = new FutureLatch(); sessionExecutor.execute(future); boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); if (!ok) { ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing(); } }
private void waitForOnMessageToComplete(boolean waitForOnMessage) { if (handler == null) { return; } if (!waitForOnMessage || Thread.currentThread() == onMessageThread) { // If called from inside onMessage then return immediately - otherwise would block return; } FutureLatch future = new FutureLatch(); sessionExecutor.execute(future); boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); if (!ok) { ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing(); } }
private void waitForOnMessageToComplete(boolean waitForOnMessage) { if (handler == null) { return; } if (!waitForOnMessage || Thread.currentThread() == onMessageThread) { // If called from inside onMessage then return immediately - otherwise would block return; } FutureLatch future = new FutureLatch(); sessionExecutor.execute(future); boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); if (!ok) { ActiveMQClientLogger.LOGGER.timeOutWaitingForProcessing(); } }
@Override public void flushExecutor() { FutureLatch future = new FutureLatch(); executor.execute(future); if (!future.await(10000)) { ActiveMQServerLogger.LOGGER.couldNotFinishExecutor(this.toString()); server.threadDump(); } }
public void flushExecutor() { FutureLatch future = new FutureLatch(); executor.execute(future); if (!future.await(10000)) { ActiveMQServerLogger.LOGGER.couldNotFlushClusterManager(this.toString()); server.threadDump(); } }
private void awaitExecution() { FutureLatch future = new FutureLatch(); executor.execute(future); future.await(10000); }
@Override public void flushExecutors() { cursorProvider.flushExecutors(); FutureLatch future = new FutureLatch(); executor.execute(future); if (!future.await(60000)) { ActiveMQServerLogger.LOGGER.pageStoreTimeout(address); } }
@Override public void setTransferring(final boolean transferring) { synchronized (lock) { // This is to make sure that the delivery process has finished any pending delivery // otherwise a message may sneak in on the client while we are trying to stop the consumer boolean locked = lockDelivery(); try { this.transferring = transferring; } finally { if (locked) { lockDelivery.writeLock().unlock(); } } } // Outside the lock if (transferring) { // And we must wait for any force delivery to be executed - this is executed async so we add a future to the // executor and // wait for it to complete FutureLatch future = new FutureLatch(); messageQueue.getExecutor().execute(future); boolean ok = future.await(10000); if (!ok) { ActiveMQServerLogger.LOGGER.errorTransferringConsumer(); } } if (!transferring) { promptDelivery(); } }
FutureLatch future = new FutureLatch(handlersCopy.length); for (ActiveMQMessageHandler handler : handlersCopy) { handler.interruptConsumer(future);
FutureLatch future = new FutureLatch(handlersCopy.length); for (ActiveMQMessageHandler handler : handlersCopy) { handler.interruptConsumer(future);