本文整理匯總了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();
}