Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.BrokerService.waitUntilStopped()


                }
            }
        } finally {
            if (broker != null) {
                broker.stop();
                broker.waitUntilStopped();
                broker = null;
            }
        }
    }
View Full Code Here


                    assertEquals(1, countMbeans(networkedBroker, "networkBridge", 2000));
                    assertEquals(1, countMbeans(broker, "networkBridge", 2000));
                    assertEquals(2, countMbeans(broker, "connectionName"));
                } finally {
                    networkedBroker.stop();
                    networkedBroker.waitUntilStopped();
                }
                assertEquals(0, countMbeans(networkedBroker, "stopped"));
                assertEquals(0, countMbeans(broker, "networkBridge"));
            }
View Full Code Here

                    broker.start();
                    assertEquals(1, countMbeans(networkedBroker, "networkBridge", 5000));
                    assertEquals("restart number: " + i, 2, countMbeans(broker, "connectionName", 10000));
                } finally {
                    broker.stop();
                    broker.waitUntilStopped();
                }
                assertEquals(0, countMbeans(broker, "stopped"));
            }

            assertEquals(1, countMbeans(networkedBroker, "connector=networkConnectors"));
View Full Code Here

        final Iterator<BrokerService> it = brokers.iterator();
        while (it.hasNext()) {
            final BrokerService bs = it.next();
            try {
                bs.stop();
                bs.waitUntilStopped();
            } catch (final Throwable t) {
                //Ignore
            }
            it.remove();
        }
View Full Code Here

    }

    protected void stopBroker(String name) throws Exception {
        BrokerService broker = brokers.remove(name);
        broker.stop();
        broker.waitUntilStopped();
    }

    protected BrokerService removeBroker(String name) {
        return brokers.remove(name);
    }
View Full Code Here

        assertTrue("Threads are leaking: " + ThreadExplorer.show("active sleep") + ", threadCount=" +threadCountAfterStart + " threadCountAfterSleep=" + threadCountAfterSleep,
                threadCountAfterSleep < threadCountAfterStart + 8);

        connection.close();
        broker.stop();
        broker.waitUntilStopped();

        // testNoDanglingThreadsAfterStop with tcp transport
        broker = new BrokerService();
        broker.setSchedulerSupport(true);
        broker.setDedicatedTaskRunner(true);
View Full Code Here

        cf = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000");
        connection = cf.createConnection("system", "manager");
        connection.start();
        connection.close();
        broker.stop();
        broker.waitUntilStopped();

        // let it settle
        TimeUnit.SECONDS.sleep(5);       

        // get final threads but filter out any daemon threads that the JVM may have created.
View Full Code Here

                    assertEquals(1, countMbeans(networkedBroker, "networkBridge", 2000));
                    assertEquals(1, countMbeans(broker, "networkBridge", 2000));
                    assertEquals(1, countMbeans(broker, "connectionName"));
                } finally {
                    networkedBroker.stop();
                    networkedBroker.waitUntilStopped();
                }
                assertEquals(0, countMbeans(networkedBroker, "stopped"));
                assertEquals(0, countMbeans(broker, "networkBridge"));
            }
View Full Code Here

                    broker.start();
                    assertEquals(1, countMbeans(networkedBroker, "networkBridge", 5000));
                    assertEquals("restart number: " + i, 1, countMbeans(broker, "connectionName", 10000));
                } finally {
                    broker.stop();
                    broker.waitUntilStopped();
                }
                assertEquals(0, countMbeans(broker, "stopped"));
            }

            assertEquals(1, countMbeans(networkedBroker, "connector=networkConnectors"));
View Full Code Here

            doTestNetworkSendReceive(brokerB, currentMaster);

            LOG.info("Stopping " + currentMaster.getBrokerObjectName().getKeyProperty("BrokerName"));
            currentMaster.stop();
            currentMaster.waitUntilStopped();
        }

        done.set(true);
        LOG.info("all done");
        executorService.shutdownNow();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.