/** * Sets hooks to be executed when broker shut down * * @org.apache.xbean.Property */ public void setShutdownHooks(List<Runnable> hooks) throws Exception { for (Runnable hook : hooks) { addShutdownHook(hook); } }
private void stopActiveMqBrokerAndAwait() throws Exception { logger.debug("Stopping ActiveMQ broker and will await shutdown"); if (!this.activeMQBroker.isStarted()) { logger.debug("Broker not running"); return; } final CountDownLatch latch = new CountDownLatch(1); this.activeMQBroker.addShutdownHook(new Runnable() { public void run() { latch.countDown(); } }); this.activeMQBroker.stop(); assertTrue("Broker did not stop", latch.await(5, TimeUnit.SECONDS)); logger.debug("Broker stopped"); }
@After public void tearDown() throws Exception { try { this.client.shutdown(); } catch (Throwable ex) { logger.error("Failed to shut client", ex); } final CountDownLatch latch = new CountDownLatch(1); this.activeMQBroker.addShutdownHook(latch::countDown); logger.debug("Stopping ActiveMQ broker and will await shutdown"); this.activeMQBroker.stop(); if (!latch.await(5, TimeUnit.SECONDS)) { logger.debug("ActiveMQ broker did not shut in the expected time."); } }
private void doStartBroker() throws Exception { checkStartException(); startDestinations(); addShutdownHook();
/** * Sets hooks to be executed when broker shut down * * @org.apache.xbean.Property */ public void setShutdownHooks(List<Runnable> hooks) throws Exception { for (Runnable hook : hooks) { addShutdownHook(hook); } }
/** * Sets hooks to be executed when broker shut down * * @org.apache.xbean.Property */ public void setShutdownHooks(List<Runnable> hooks) throws Exception { for (Runnable hook : hooks) { addShutdownHook(hook); } }
/** * Sets hooks to be executed when broker shut down * * @org.apache.xbean.Property */ public void setShutdownHooks(List<Runnable> hooks) throws Exception { for (Runnable hook : hooks) { addShutdownHook(hook); } }
/** * Sets hooks to be executed when broker shut down * * @org.apache.xbean.Property */ public void setShutdownHooks(List<Runnable> hooks) throws Exception { for (Runnable hook : hooks) { addShutdownHook(hook); } }
broker.addShutdownHook(new Runnable() { public void run() { shutdownLatch.countDown();
broker.addShutdownHook(new Runnable() { public void run() { shutdownLatch.countDown();
broker.addShutdownHook(new Runnable() { public void run() { shutdownLatch.countDown();
server.getBroker().addShutdownHook(new Runnable() { @Override public void run() {
server.getBroker().addShutdownHook(new Runnable() { @Override public void run() {
slave = false; startDestinations(); addShutdownHook(); getBroker().start(); if (isUseJmx()) {
private void doStartBroker() throws Exception { checkStartException(); startDestinations(); addShutdownHook();
private void doStartBroker() throws Exception { checkStartException(); startDestinations(); addShutdownHook();
private void doStartBroker() throws Exception { checkStartException(); startDestinations(); addShutdownHook();