當前位置: 首頁>>代碼示例>>Java>>正文


Java BrokerService.getBrokerName方法代碼示例

本文整理匯總了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;
}
 
開發者ID:vert-x3,項目名稱:vertx-amqp-bridge,代碼行數:14,代碼來源:ActiveMQTestBase.java

示例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");
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:14,代碼來源:MessageBrokerView.java

示例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;
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:33,代碼來源:DuplexNetworkMBeanTest.java

示例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);
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:8,代碼來源:ThreeBrokerVirtualTopicNetworkLevelDBTest.java

示例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);
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:8,代碼來源:TwoBrokerVirtualDestDinamicallyIncludedDestTest.java

示例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;

}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:37,代碼來源:DurableSubscriberWithNetworkRestartTest.java

示例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() + ":");
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:11,代碼來源:JmsMultipleBrokersTestSupport.java

示例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);
}
 
開發者ID:apache,項目名稱:activemq-artemis,代碼行數:7,代碼來源:ThreeBrokerVirtualTopicNetworkTest.java


注:本文中的org.apache.activemq.broker.BrokerService.getBrokerName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。