当前位置: 首页>>代码示例>>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;未经允许,请勿转载。