本文整理汇总了Java中org.apache.activemq.broker.BrokerService.getBrokerName方法的典型用法代码示例。如果您正苦于以下问题:Java BrokerService.getBrokerName方法的具体用法?Java BrokerService.getBrokerName怎么用?Java BrokerService.getBrokerName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.broker.BrokerService
的用法示例。
在下文中一共展示了BrokerService.getBrokerName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restartBroker
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
public BrokerService restartBroker(BrokerService brokerService) throws Exception {
String name = brokerService.getBrokerName();
Map<String, Integer> portMap = new HashMap<String, Integer>();
for (TransportConnector connector : brokerService.getTransportConnectors()) {
portMap.put(connector.getName(), connector.getPublishableConnectURI().getPort());
}
stopBroker(brokerService);
BrokerService broker = createBroker(name, false, portMap);
broker.start();
broker.waitUntilStarted();
return broker;
}
示例2: MessageBrokerView
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
/**
* Create a view of a running Broker
* @param brokerService
*/
public MessageBrokerView(BrokerService brokerService){
this.brokerService = brokerService;
if (brokerService == null){
throw new NullPointerException("BrokerService is null");
}
if (!brokerService.isStarted()){
throw new IllegalStateException("BrokerService " + brokerService.getBrokerName() + " is not started");
}
}
示例3: countMbeans
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private int countMbeans(BrokerService broker, String type, int timeout) throws Exception {
final long expiryTime = System.currentTimeMillis() + timeout;
if (!type.contains("=")) {
type = type + "=*";
}
final ObjectName beanName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + broker.getBrokerName() + "," + type + ",*");
Set<ObjectName> mbeans = null;
int count = 0;
do {
if (timeout > 0) {
Thread.sleep(100);
}
LOG.info("Query name: " + beanName);
mbeans = broker.getManagementContext().queryNames(beanName, null);
if (mbeans != null) {
count = mbeans.size();
} else {
logAllMbeans(broker);
}
} while ((mbeans == null || mbeans.isEmpty()) && expiryTime > System.currentTimeMillis());
// If port 1099 is in use when the Broker starts, starting the jmx connector
// will fail. So, if we have no mbsc to query, skip the test.
if (timeout > 0) {
assumeNotNull(mbeans);
}
return count;
}
示例4: configurePersistenceAdapter
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
File dataFileDir = new File("target/test-amq-data/leveldb/" + broker.getBrokerName());
LevelDBStore kaha = new LevelDBStore();
kaha.setDirectory(dataFileDir);
broker.setPersistenceAdapter(kaha);
}
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:SingleBrokerVirtualDestinationsWithWildcardLevelDBTest.java
示例5: configurePersistenceAdapter
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
@Override
protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
File dataFileDir = new File("target/test-data/leveldb/" + broker.getBrokerName());
LevelDBStore adapter = new LevelDBStore();
adapter.setDirectory(dataFileDir);
broker.setPersistenceAdapter(adapter);
}
示例6: configurePersistenceAdapter
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
File dataFileDir = new File("target/test-amq-data/kahadb/" + broker.getBrokerName());
KahaDBStore kaha = new KahaDBStore();
kaha.setDirectory(dataFileDir);
kaha.deleteAllMessages();
broker.setPersistenceAdapter(kaha);
}
示例7: countMbeans
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
private int countMbeans(BrokerService broker, String type, int timeout) throws Exception {
final long expiryTime = System.currentTimeMillis() + timeout;
if (!type.contains("=")) {
type = type + "=*";
}
final ObjectName beanName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + broker.getBrokerName() + "," + type + ",*");
Set<ObjectName> mbeans = null;
int count = 0;
do {
if (timeout > 0) {
Thread.sleep(100);
}
mbeans = broker.getManagementContext().queryNames(beanName, null);
if (mbeans != null) {
count = mbeans.size();
LOG.info("Found: " + count + ", matching type: " + type);
for (ObjectName objectName : mbeans) {
LOG.info("" + objectName);
}
//} else {
//logAllMbeans(broker);
}
} while ((mbeans == null || mbeans.isEmpty()) && expiryTime > System.currentTimeMillis());
// If port 1099 is in use when the Broker starts, starting the jmx connector
// will fail. So, if we have no mbsc to query, skip the test.
if (timeout > 0) {
assumeNotNull(mbeans);
}
return count;
}
示例8: BrokerItem
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
public BrokerItem(BrokerService broker) throws Exception {
this.broker = broker;
factory = new ActiveMQConnectionFactory(broker.getVmConnectorURI());
factory.setConnectionIDPrefix(broker.getBrokerName());
consumers = Collections.synchronizedMap(new HashMap<MessageConsumer, MessageIdList>());
connections = Collections.synchronizedList(new ArrayList<Connection>());
allMessages.setVerbose(verbose);
id = new IdGenerator(broker.getBrokerName() + ":");
}
示例9: configurePersistenceAdapter
import org.apache.activemq.broker.BrokerService; //导入方法依赖的package包/类
protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
File dataFileDir = new File("target/test-amq-data/kahadb/" + broker.getBrokerName());
KahaDBStore kaha = new KahaDBStore();
kaha.setDirectory(dataFileDir);
broker.setPersistenceAdapter(kaha);
}