當前位置: 首頁>>代碼示例>>Java>>正文


Java BrokerService.getSystemUsage方法代碼示例

本文整理匯總了Java中org.apache.activemq.broker.BrokerService.getSystemUsage方法的典型用法代碼示例。如果您正苦於以下問題:Java BrokerService.getSystemUsage方法的具體用法?Java BrokerService.getSystemUsage怎麽用?Java BrokerService.getSystemUsage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.activemq.broker.BrokerService的用法示例。


在下文中一共展示了BrokerService.getSystemUsage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
/**
 * @param The activemq connector uri, for instance: "failover:(tcp://localhost:61616)?startupMaxReconnectAttempts=3"
 *        The failover:() is stipped out so that a tcp:// uri is created for the server.
 */
@Override
public URI start(String suggestedURI) throws EventException {

	try {
		Pattern pattern = Pattern.compile(".*(tcp://[a-zA-Z\\.]+:\\d+).*");
		Matcher matcher = pattern.matcher(suggestedURI);
		if (matcher.matches()) suggestedURI = matcher.group(1);

		URI uri = new URI(suggestedURI); // Each test uses a new port if the port is running on another test.
		service = new BrokerService();
        service.addConnector(uri);
        service.setPersistent(false);
		service.addConnector("stomp://localhost:61613"); // Allow stomp connections (for Python clients, etc.).
        SystemUsage systemUsage = service.getSystemUsage();
        systemUsage.getStoreUsage().setLimit(1024 * 1024 * 8);
        systemUsage.getTempUsage().setLimit(1024 * 1024 * 8);
        service.start();
		service.waitUntilStarted();
		return uri;

	} catch (Exception ne) {
		throw new EventException(ne);
	}
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:29,代碼來源:ActivemqConnectorService.java

示例2: start

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
public void start() throws Exception {
	uri = createUri(); // Each test uses a new port if the port is running on another test.
	System.setProperty("org.eclipse.scanning.broker.uri", uri.toString());
       service = new BrokerService();
       service.addConnector(uri);
       service.setPersistent(false);
       SystemUsage systemUsage = service.getSystemUsage();
       systemUsage.getStoreUsage().setLimit(1024 * 1024 * 8);
       systemUsage.getTempUsage().setLimit(1024 * 1024 * 8);
       service.start();
	boolean ok = service.waitUntilStarted();
	if (!ok) throw new Exception("Broker was not started properly!");
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:14,代碼來源:BrokerDelegate.java

示例3: SchedulerBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
public SchedulerBroker(BrokerService brokerService, Broker next, JobSchedulerStore store) throws Exception {
    super(next);

    this.store = store;
    this.producerId.setConnectionId(ID_GENERATOR.generateId());
    this.context.setSecurityContext(SecurityContext.BROKER_SECURITY_CONTEXT);
    this.context.setBroker(next);
    this.systemUsage = brokerService.getSystemUsage();

    wireFormat.setVersion(brokerService.getStoreOpenWireVersion());
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:12,代碼來源:SchedulerBroker.java

示例4: createBrokerWithTempStoreLimit

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
private void createBrokerWithTempStoreLimit() throws Exception {
   brokerService = new BrokerService();
   brokerService.setUseJmx(false);
   SystemUsage usage = brokerService.getSystemUsage();
   usage.getTempUsage().setLimit(1025 * 1024 * 15);

   // put something in the temp store to on demand initialise it
   PList dud = brokerService.getTempDataStore().getPList("dud");
   dud.addFirst("A", new ByteSequence("A".getBytes()));
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:11,代碼來源:FilePendingMessageCursorTestSupport.java

示例5: startActiveMQBroker

import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
public static void startActiveMQBroker() throws Exception {
    _broker = new BrokerService();
    _broker.setBrokerName("default");
    _broker.setUseJmx(false);
    _broker.setPersistent(false);
    _broker.setDataDirectoryFile(ACTIVEMQ_DATA_DIR);
    _broker.addConnector(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL);
    SystemUsage systemUsage = _broker.getSystemUsage();
    systemUsage.getMemoryUsage().setLimit(MEMORY_STORE_USAGE_LIMIT);
    systemUsage.getTempUsage().setLimit(TEMP_STORE_USAGE_LIMIT);
    _broker.start();
}
 
開發者ID:jboss-switchyard,項目名稱:switchyard,代碼行數:13,代碼來源:JCAInflowBindingTest.java


注:本文中的org.apache.activemq.broker.BrokerService.getSystemUsage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。