當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。