Package org.apache.activemq.broker

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


                    e.printStackTrace();
                }
            }
        });
        slave.start();
        slave.waitUntilStarted();
       
        master.waitUntilStarted();
       
        LOG.info("killing slave..");
        slave.stop();
View Full Code Here


    public void testBridgeRegistration() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setBrokerName(BROKER_NAME);
        broker.setUseJmx(true); // explicitly set this so no funny issues
        broker.start();
        broker.waitUntilStarted();

        // now create network connector over JMX
        ObjectName brokerObjectName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + BROKER_NAME);
        BrokerViewMBean proxy = (BrokerViewMBean) broker.getManagementContext().newProxyInstance(brokerObjectName,
                BrokerViewMBean.class, true);
View Full Code Here

            brokerContext.setConfigurationUrl(resource.getURL().toExternalForm());
            brokerContext.setApplicationContext(ctx);
            broker.setBrokerContext(brokerContext);

            broker.start();
            broker.waitUntilStarted();
            brokers.put(pid, broker);


        } catch (Exception e) {
            throw new ConfigurationException(null, "Cannot start the broker", e);
View Full Code Here

public class JDBCLockTablePrefixTest extends TestCase {

    public void testLockTable() throws Exception {
        BrokerService broker = BrokerFactory.createBroker("xbean:org/apache/activemq/store/jdbc/JDBCLockTablePrefix.xml");
        broker.waitUntilStarted();

        PersistenceAdapter pa = broker.getPersistenceAdapter();
        assertNotNull(pa);

        JDBCPersistenceAdapter jpa = (JDBCPersistenceAdapter) pa;
View Full Code Here

        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
        broker.setDestinationPolicy(pMap);

        broker.start();
        broker.waitUntilStarted();

        return broker;
    }

    /**
 
View Full Code Here

        }

        this.localDataSource = localDataSource;

        broker.start();
        broker.waitUntilStarted();

        return broker;
    }

    /**
 
View Full Code Here

    public void testRollbackXaErrorCode() throws Exception {
        String brokerName = "rollbackErrorCode";
        BrokerService broker = BrokerFactory.createBroker(new URI("broker:(tcp://localhost:0)/" + brokerName));
        broker.start();
        broker.waitUntilStarted();
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory(broker.getTransportConnectors().get(0).getConnectUri());
        XAConnection connection = (XAConnection)cf.createConnection();
        connection.start();
        XASession session = connection.createXASession();
        XAResource resource = session.getXAResource();
View Full Code Here

    protected BrokerService createBroker() throws Exception {
        BrokerService answer = new BrokerService();
        configureBroker(answer);
        answer.start();
        answer.waitUntilStarted();
        bindAddress = answer.getTransportConnectors().get(0).getConnectUri().toString();
        return answer;
    }

    protected void configureBroker(BrokerService answer) throws Exception {
View Full Code Here

    protected void startAllBrokers() throws Exception {
        Collection<BrokerItem> brokerList = brokers.values();
        for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
            BrokerService broker = i.next().broker;
            broker.start();
            broker.waitUntilStarted();
        }

        Thread.sleep(maxSetupTime);
    }
View Full Code Here

        // connection filter is bypassed when scheme is different
        final NetworkConnector networkConnector = brokerServce.addNetworkConnector("static:(tcp://"
                + transportConnector.getConnectUri().getHost() + ":" +  transportConnector.getConnectUri().getPort() + ")");

        brokerServce.start();
        brokerServce.waitUntilStarted();

        try {
            Wait.waitFor(new Wait.Condition() {
                @Override
                public boolean isSatisified() throws Exception {
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.