コード例 #1
0
 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();
 }
コード例 #2
0
  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;
  }
コード例 #3
0
 protected void createMaster() throws Exception {
   BrokerFactoryBean brokerFactory = new BrokerFactoryBean(new ClassPathResource(getMasterXml()));
   brokerFactory.afterPropertiesSet();
   master = brokerFactory.getBroker();
   master.start();
 }