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