Refine search
@After public void stopBroker() throws Exception { broker.stop(); broker.waitUntilStopped(); }
@Override protected void tearDown() throws Exception { LOG.info("Closing down connection"); try { session.close(); session = null; } catch (Exception e) { LOG.info("Caught exception while closing resources."); } try { connection.close(); connection = null; } catch (Exception e) { LOG.info("Caught exception while closing resources."); } try { broker.stop(); broker.waitUntilStopped(); broker = null; } catch (Exception e) { LOG.info("Caught exception while shutting down the Broker", e); } LOG.info("Connection closed."); }
@After public void tearDown() throws Exception { brokerService.stop(); brokerService.waitUntilStopped(); }
public void stop() { try { broker.stop(); broker.waitUntilStopped(); } catch (Exception e) { throw new RuntimeException(e); } }
@After public void stopBroker() throws Exception { if (brokerService != null) { brokerService.stop(); brokerService.waitUntilStopped(); brokerService = null; } } }
public synchronized void doStop() throws Exception { if (asyncStartup) { active.set(false); // ActiveMQ AMQPersistenceAdapter can hang, if we are still starting if (asyncStarted.getCount() > 0) { return; } } brokerService.stop(); brokerService.waitUntilStopped(); }
@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."); } }
@Override synchronized public void deleted(String pid) { BrokerService broker = brokers.get(pid); if (broker == null) { return; } try { LOG.info("Stopping broker " + pid); broker.stop(); broker.waitUntilStopped(); } catch (Exception e) { LOG.error("Exception on stopping broker", e); } }
public void stop() { try { broker.stop(); broker.waitUntilStopped(); } catch (Exception e) { throw ExceptionUtil.rethrow(e); } } }
public void stopProvider () { BrokerService brokerService = getProvider(); try { if (brokerService != null) { brokerService.stop(); brokerService.waitUntilStopped(); } else { log.info("Could not stop ActiveMQ broker. It was never started"); } } catch (Exception e) { log.error("Failed to stop JMS Server", e); } }
@Override public void after() { try { m_broker.stop(); m_broker.waitUntilStopped(); } catch (Throwable e) { LOG.warn("An error occurred while stopping the broker.", e); } try { if (m_temporaryDirectory != null) { Files.walkFileTree(m_temporaryDirectory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Files.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); } } catch (IOException e) { LOG.warn("An error occurred while deleting the temporary directory '{}'.", m_temporaryDirectory, e); } } }
@Override public void after() { try { m_broker.stop(); m_broker.waitUntilStopped(); } catch (Throwable e) { LOG.warn("An error occurred while stopping the broker.", e); } try { if (m_temporaryDirectory != null) { Files.walkFileTree(m_temporaryDirectory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Files.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); } } catch (IOException e) { LOG.warn("An error occurred while deleting the temporary directory '{}'.", m_temporaryDirectory, e); } } }
public synchronized void doFail() { if (asyncStartup) { active.set(false); // ActiveMQ AMQPersistenceAdapter can hang, if we are still starting if (asyncStarted.getCount() > 0) { return; } } try { brokerService.stop(); brokerService.waitUntilStopped(); } catch (JMSException ignored) { // just a lame exception ActiveMQ likes to throw on shutdown if (!(ignored.getCause() instanceof TransportDisposedIOException)) { log.warn("Caught while closing due to failure: " + ignored, ignored); } } catch (Exception e) { log.warn("Caught while closing due to failure: " + e, e); } }