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();
 }
  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;
  }
 protected void createMaster() throws Exception {
   BrokerFactoryBean brokerFactory = new BrokerFactoryBean(new ClassPathResource(getMasterXml()));
   brokerFactory.afterPropertiesSet();
   master = brokerFactory.getBroker();
   master.start();
 }