Package org.apache.activemq.xbean

Examples of org.apache.activemq.xbean.BrokerFactoryBean


    protected BrokerService createBroker(String resource) throws Exception {
        return createBroker(new ClassPathResource(resource));
    }

    protected BrokerService createBroker(Resource resource) throws Exception {
        BrokerFactoryBean factory = new BrokerFactoryBean(resource);
        factory.afterPropertiesSet();

        BrokerService broker = factory.getBroker();

        assertTrue("Should have a broker!", broker != null);

        // Broker is already started by default when using the XML file
        // broker.start();
View Full Code Here


        if (brokerURI == null) {
            brokerURI = "activemq.xml";
        }
        context.log("Loading ActiveMQ Broker configuration from: " + brokerURI);
        Resource resource = new ServletContextResource(context, brokerURI);
        BrokerFactoryBean factory = new BrokerFactoryBean(resource);
        try {
            factory.afterPropertiesSet();
        } catch (Exception e) {
            context.log("Failed to create broker: " + e, e);
        }
        return factory.getBroker();
    }
View Full Code Here

    protected BrokerService createBroker(String resource) throws Exception {
        return createBroker(new ClassPathResource(resource));
    }

    protected BrokerService createBroker(Resource resource) throws Exception {
        BrokerFactoryBean factory = new BrokerFactoryBean(resource);
        factory.afterPropertiesSet();

        BrokerService broker = factory.getBroker();

        assertTrue("Should have a broker!", broker != null);

        // Broker is already started by default when using the XML file
        // broker.start();
View Full Code Here

    }

    protected ActiveMQConnectionFactory createConnectionFactory(String config, String brokerName,
                                                                String connectUrl) throws JMSException {
        try {
            BrokerFactoryBean brokerFactory = new BrokerFactoryBean(new ClassPathResource(config));
            brokerFactory.afterPropertiesSet();
            BrokerService broker = brokerFactory.getBroker();
            brokers.put(brokerName, broker);

            return new ActiveMQConnectionFactory(connectUrl);

        } catch (Exception e) {
View Full Code Here

public class KahaQueueTest extends SimpleQueueTest {
    final static String config = "org/apache/activemq/perf/kahadbBroker.xml";

    protected BrokerService createBroker(String uri) throws Exception {
        Resource resource = new ClassPathResource(config);
        BrokerFactoryBean brokerFactory = new BrokerFactoryBean(resource);
        resource = new ClassPathResource(config);
        brokerFactory = new BrokerFactoryBean(resource);
        brokerFactory.afterPropertiesSet();
        return brokerFactory.getBroker();
    }
View Full Code Here

    }

    protected BrokerService createBroker(String url) throws Exception {
        Resource resource = new ClassPathResource("org/apache/activemq/perf/slowConsumerBroker.xml");
        System.err.println("CREATE BROKER FROM " + resource);
        BrokerFactoryBean factory = new BrokerFactoryBean(resource);
        factory.afterPropertiesSet();
        BrokerService broker = factory.getBroker();
       
        broker.start();
        return broker;
    }
View Full Code Here

     * @throws java.lang.Exception
     */
    protected void setUp() throws Exception {
        LOG.info("setUp() called.");
        ClassPathXmlApplicationContext context1 = null;
        BrokerFactoryBean brokerFactory = new BrokerFactoryBean(new ClassPathResource(config));

        /* start up first broker instance */
        try {
            // resolve broker1
            Thread.currentThread().setContextClassLoader(
View Full Code Here

    protected boolean isTopic() {
        return false;
    }

    protected void createMaster() throws Exception {
        BrokerFactoryBean brokerFactory = new BrokerFactoryBean(new ClassPathResource(getMasterXml()));
        brokerFactory.afterPropertiesSet();
        master = brokerFactory.getBroker();
        master.start();
    }
View Full Code Here

        master = brokerFactory.getBroker();
        master.start();
    }

    protected void createSlave() throws Exception {
        BrokerFactoryBean brokerFactory = new BrokerFactoryBean(new ClassPathResource(getSlaveXml()));
        brokerFactory.afterPropertiesSet();
        BrokerService broker = brokerFactory.getBroker();
        broker.start();
        slave.set(broker);
        slaveStarted.countDown();
    }
View Full Code Here

        container.init();
        container.start();
    }

    protected void createJmsBroker() throws Exception {
        BrokerFactoryBean bfb = new BrokerFactoryBean(new ClassPathResource("org/apache/servicemix/jms/activemq.xml"));
        bfb.afterPropertiesSet();
        broker = bfb.getBroker();
        configureJmsBroker();
        broker.start();
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.xbean.BrokerFactoryBean

Copyright © 2018 www.massapicom. 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.