本文整理汇总了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);
}
}
示例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!");
}
示例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());
}
示例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()));
}
示例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();
}