Search in sources :

Example 16 with BrokerFactoryBean

use of org.apache.activemq.xbean.BrokerFactoryBean in project activemq-artemis by apache.

the class TwoBrokerTopicSendReceiveTest method createConnectionFactory.

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) {
        e.printStackTrace();
    }
    return null;
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) BrokerFactoryBean(org.apache.activemq.xbean.BrokerFactoryBean) BrokerService(org.apache.activemq.broker.BrokerService) ClassPathResource(org.springframework.core.io.ClassPathResource) JMSException(javax.jms.JMSException)

Example 17 with BrokerFactoryBean

use of org.apache.activemq.xbean.BrokerFactoryBean in project activemq-artemis by apache.

the class ConfigTest method createBroker.

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);
    return broker;
}
Also used : BrokerFactoryBean(org.apache.activemq.xbean.BrokerFactoryBean) BrokerService(org.apache.activemq.broker.BrokerService)

Example 18 with BrokerFactoryBean

use of org.apache.activemq.xbean.BrokerFactoryBean in project activemq-artemis by apache.

the class SlowConsumerTopicTest method createBroker.

@Override
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;
}
Also used : BrokerFactoryBean(org.apache.activemq.xbean.BrokerFactoryBean) ClassPathResource(org.springframework.core.io.ClassPathResource) Resource(org.springframework.core.io.Resource) BrokerService(org.apache.activemq.broker.BrokerService) ClassPathResource(org.springframework.core.io.ClassPathResource)

Aggregations

BrokerFactoryBean (org.apache.activemq.xbean.BrokerFactoryBean)18 BrokerService (org.apache.activemq.broker.BrokerService)14 ClassPathResource (org.springframework.core.io.ClassPathResource)13 Resource (org.springframework.core.io.Resource)6 JMSException (javax.jms.JMSException)1 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)1 ClassPathXmlApplicationContext (org.apache.xbean.spring.context.ClassPathXmlApplicationContext)1