当前位置: 首页>>代码示例>>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;未经允许,请勿转载。