当前位置: 首页>>代码示例>>Java>>正文


Java BrokerService.setDataDirectory方法代码示例

本文整理汇总了Java中org.apache.activemq.broker.BrokerService.setDataDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java BrokerService.setDataDirectory方法的具体用法?Java BrokerService.setDataDirectory怎么用?Java BrokerService.setDataDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.broker.BrokerService的用法示例。


在下文中一共展示了BrokerService.setDataDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private boolean startBroker() {
    try {
        log.info("JMSServerController: Preparing to start JMS Broker: " );
        broker = new BrokerService();
        // configure the broker

        broker.setBrokerName("myBroker1");
        log.info(broker.getBrokerDataDirectory());
        broker.setDataDirectory(System.getProperty(FrameworkConstants.CARBON_HOME) +
                File.separator + broker.getBrokerDataDirectory());
        broker.setTransportConnectors(getTCPConnectors());
        broker.setPersistent(true);

        broker.start();
        log.info("JMSServerController: Broker is Successfully started. continuing tests");
        return true;
    } catch (Exception e) {
        log.error(
                "JMSServerController: There was an error starting JMS broker: ", e);
        return false;
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:23,代码来源:JMSEndpointSuspensionViaVFSTest.java

示例2: configureBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected void configureBroker(BrokerService broker) throws Exception {
    broker.setUseJmx(true);
    broker.setPersistent(true);
    broker.setDataDirectory("target/activemq-data");
    broker.deleteAllMessages();
    broker.setAdvisorySupport(true);
    broker.addConnector(brokerUri);

    // configure expiration rate
    ActiveMQQueue queueName = new ActiveMQQueue(">");
    PolicyEntry entry = new PolicyEntry();
    entry.setDestination(queueName);
    entry.setExpireMessagesPeriod(1000);

    PolicyMap policyMap = new PolicyMap();
    policyMap.put(queueName, entry);
    broker.setDestinationPolicy(policyMap);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:QueueProducerQoSTest.java

示例3: createBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected BrokerService createBroker(String name, boolean deleteMessagesOnStartup,
                                     Map<String, Integer> portMap) throws Exception {
  BrokerService brokerService = new BrokerService();
  brokerService.setBrokerName(name);
  brokerService.setDeleteAllMessagesOnStartup(deleteMessagesOnStartup);
  brokerService.setUseJmx(true);
  brokerService.getManagementContext().setCreateConnector(false);
  brokerService.setDataDirectory(DATA_PARENT_DIR + File.separator + "data" + File.separator + name);
  brokerService.setPersistent(false);
  brokerService.setSchedulerSupport(false);
  brokerService.setAdvisorySupport(false);

  ArrayList<BrokerPlugin> plugins = new ArrayList<BrokerPlugin>();
  BrokerPlugin authenticationPlugin = configureAuthentication();
  if (authenticationPlugin != null) {
    plugins.add(authenticationPlugin);
  }

  if (!plugins.isEmpty()) {
    brokerService.setPlugins(plugins.toArray(new BrokerPlugin[0]));
  }

  addAdditionalConnectors(brokerService, portMap);

  return brokerService;
}
 
开发者ID:vert-x3,项目名称:vertx-amqp-bridge,代码行数:27,代码来源:ActiveMQTestBase.java

示例4: createBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected BrokerService createBroker(boolean delete) throws Exception {
   File schedulerDirectory = new File("target/scheduler");
   if (delete) {
      IOHelper.mkdirs(schedulerDirectory);
      IOHelper.deleteChildren(schedulerDirectory);
   }

   BrokerService answer = new BrokerService();
   answer.setPersistent(isPersistent());
   answer.setDeleteAllMessagesOnStartup(true);
   answer.setDataDirectory("target");
   answer.setSchedulerDirectoryFile(schedulerDirectory);
   answer.setSchedulerSupport(true);
   answer.setUseJmx(isUseJmx());
   return answer;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:17,代码来源:JobSchedulerTestSupport.java

示例5: setInitialConfigurations

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
/**
 * Helper method to set initial broker configurations.
 *
 * @throws Exception if there is an error setting TransportConnectors
 */
private void setInitialConfigurations() throws Exception {
    log.info("JMSServerController: Preparing to start JMS Broker: " + serverName);
    broker = new BrokerService();
    broker.setBrokerName(serverName);
    log.info(broker.getBrokerDataDirectory());
    broker.setDataDirectory(System.getProperty(FrameworkConstants.CARBON_HOME) + File.separator
            + broker.getBrokerDataDirectory());
    broker.setTransportConnectors(transportConnectors);
    broker.setPersistent(true);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:16,代码来源:JMSBroker.java

示例6: setupJmsBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private BrokerService setupJmsBroker() throws IOException, URISyntaxException, Exception
{
	//
	// we want to connect to an independently running JMS broker.
	final BrokerService broker = new BrokerService();
	broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
	broker.setDataDirectory("target/activemq-data");
	final TransportConnector connector = new TransportConnector();
	connector.setUri(new URI("tcp://localhost:61616"));
	broker.addConnector(connector);
	broker.start();
	return broker;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:14,代码来源:JaxRsSpringEndpointTests.java

示例7: setupJmsBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private BrokerService setupJmsBroker() throws IOException, URISyntaxException, Exception
{
	//
	// we want to connect to an independently running JMS broker.
	final BrokerService broker = new BrokerService();
	broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
	broker.setDataDirectory("target/activemq-data");
	final TransportConnector connector = new TransportConnector();
	connector.setUri(new URI(JMS_URL));
	broker.addConnector(connector);
	broker.start();

	return broker;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:15,代码来源:JaxRsProgramaticTests.java

示例8: createJmsBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private BrokerService createJmsBroker() throws IOException, URISyntaxException, Exception
{
	//
	// we want to connect to an independently running JMS broker.
	final BrokerService broker = new BrokerService();
	broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
	broker.setDataDirectory("target/activemq-data");
	final TransportConnector connector = new TransportConnector();
	connector.setUri(new URI(JMS_URL));
	broker.addConnector(connector);
	broker.start();

	return broker;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:15,代码来源:JaxRsOneWayTests.java

示例9: JMSBrokerService

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
public JMSBrokerService(String url) throws Exception {
    System.setProperty(JMSTestConstants.ACTIVEMQ_LOGIN_CONFIG,
            getClass().getClassLoader().getResource(JMSTestConstants.ACTIVEMQ_LOGIN_CONFIG_DIR).getPath());
    broker = new BrokerService();
    broker.setDataDirectory(JMSTestConstants.TEST_LOG_DIR);
    broker.setBrokerName(BROKER_NAME);
    broker.addConnector(url);
    broker.setPlugins(new BrokerPlugin[] { new JaasAuthenticationPlugin() });
}
 
开发者ID:wso2,项目名称:carbon-transports,代码行数:10,代码来源:JMSBrokerService.java

示例10: createBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected BrokerService createBroker() throws Exception {
   BrokerService broker = super.createBroker();
   broker.setPersistent(true);
   broker.setBrokerName("local");
   broker.setDataDirectory("target/activemq-data");
   broker.setDeleteAllMessagesOnStartup(true);
   TransportConnector tc = broker.addConnector(getDefaultMQTTTransportConnectorUri());
   localBrokerMQTTPort = tc.getConnectUri().getPort();
   return broker;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:12,代码来源:MQTTNetworkOfBrokersFailoverTest.java

示例11: createRemoteBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected BrokerService createRemoteBroker(PersistenceAdapter persistenceAdapter) throws Exception {
   BrokerService broker = super.createRemoteBroker(persistenceAdapter);
   broker.setPersistent(true);
   broker.setDeleteAllMessagesOnStartup(true);
   broker.setDataDirectory("target/activemq-data");
   TransportConnector tc = broker.addConnector(getDefaultMQTTTransportConnectorUri());
   remoteBrokerMQTTPort = tc.getConnectUri().getPort();
   return broker;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:11,代码来源:MQTTNetworkOfBrokersFailoverTest.java

示例12: createBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private BrokerService createBroker(String listenPort, String dataDir) throws Exception {
   BrokerService broker = new BrokerService();
   broker.setUseJmx(false);
   broker.getManagementContext().setCreateConnector(false);
   broker.setBrokerName("Broker_Shared");
   // lazy create transport connector on start completion
   TransportConnector connector = new TransportConnector();
   connector.setUri(new URI("tcp://localhost:" + listenPort));
   broker.addConnector(connector);
   broker.setDataDirectory(dataDir);
   return broker;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:FailoverStaticNetworkTest.java

示例13: createBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected BrokerService createBroker(JobSchedulerStoreImpl scheduler) throws Exception {
   BrokerService answer = new BrokerService();
   answer.setJobSchedulerStore(scheduler);
   answer.setPersistent(true);
   answer.setDataDirectory("target");
   answer.setSchedulerSupport(true);
   answer.setUseJmx(false);
   return answer;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:SchedulerDBVersionTest.java

示例14: createBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected BrokerService createBroker() throws Exception {
   File schedulerDirectory = new File("target/scheduler");

   IOHelper.mkdirs(schedulerDirectory);
   IOHelper.deleteChildren(schedulerDirectory);

   BrokerService broker = super.createBroker();
   broker.setSchedulerSupport(true);
   broker.setDataDirectory("target");
   broker.setSchedulerDirectoryFile(schedulerDirectory);
   broker.getSystemUsage().getStoreUsage().setLimit(1 * 512);
   broker.deleteAllMessages();
   return broker;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:JobSchedulerBrokerShutdownTest.java

示例15: startBroker

import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private void startBroker() throws Exception {
   broker = new BrokerService();
   broker.setSchedulerSupport(true);
   broker.setPersistent(true);
   broker.setDeleteAllMessagesOnStartup(false);
   broker.setDataDirectory("target");
   broker.setSchedulerDirectoryFile(schedulerDirectory);
   broker.setDataDirectoryFile(messageDirectory);
   broker.setUseJmx(false);
   broker.addConnector("vm://localhost");
   broker.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:LostScheduledMessagesTest.java


注:本文中的org.apache.activemq.broker.BrokerService.setDataDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。