• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XAQueueConnectionFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.jms.XAQueueConnectionFactory的典型用法代码示例。如果您正苦于以下问题:Java XAQueueConnectionFactory类的具体用法?Java XAQueueConnectionFactory怎么用?Java XAQueueConnectionFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XAQueueConnectionFactory类属于javax.jms包,在下文中一共展示了XAQueueConnectionFactory类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: assertNTypes

import javax.jms.XAQueueConnectionFactory; //导入依赖的package包/类
private void assertNTypes(ActiveMQConnectionFactory factory, final int total) {
   StringBuilder text = new StringBuilder();
   text.append(factory + "\n is instance of ");
   int num = 0;
   if (factory instanceof ConnectionFactory) {
      num++;
      text.append("ConnectionFactory ");
   }
   if (factory instanceof XAConnectionFactory) {
      num++;
      text.append("XAConnectionFactory ");
   }
   if (factory instanceof QueueConnectionFactory) {
      num++;
      text.append("QueueConnectionFactory ");
   }
   if (factory instanceof TopicConnectionFactory) {
      num++;
      text.append("TopicConnectionFactory ");
   }
   if (factory instanceof XAQueueConnectionFactory) {
      num++;
      text.append("XAQueueConnectionFactory ");
   }
   if (factory instanceof XATopicConnectionFactory) {
      num++;
      text.append("XATopicConnectionFactory ");
   }
   Assert.assertEquals(text.toString(), total, num);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:31,代码来源:ConnectionFactoryTest.java


示例2: testConnectionTypes

import javax.jms.XAQueueConnectionFactory; //导入依赖的package包/类
@Test
public void testConnectionTypes() throws Exception {
   deployConnectionFactory(0, JMSFactoryType.CF, "ConnectionFactory", "/ConnectionFactory");
   deployConnectionFactory(0, JMSFactoryType.QUEUE_XA_CF, "CF_QUEUE_XA_TRUE", "/CF_QUEUE_XA_TRUE");
   deployConnectionFactory(0, JMSFactoryType.XA_CF, "CF_XA_TRUE", "/CF_XA_TRUE");
   deployConnectionFactory(0, JMSFactoryType.QUEUE_CF, "CF_QUEUE", "/CF_QUEUE");
   deployConnectionFactory(0, JMSFactoryType.TOPIC_CF, "CF_TOPIC", "/CF_TOPIC");
   deployConnectionFactory(0, JMSFactoryType.TOPIC_XA_CF, "CF_TOPIC_XA_TRUE", "/CF_TOPIC_XA_TRUE");

   Connection genericConnection = null;
   XAConnection xaConnection = null;
   QueueConnection queueConnection = null;
   TopicConnection topicConnection = null;
   XAQueueConnection xaQueueConnection = null;
   XATopicConnection xaTopicConnection = null;

   ConnectionFactory genericFactory = (ConnectionFactory) ic.lookup("/ConnectionFactory");
   genericConnection = genericFactory.createConnection();
   assertConnectionType(genericConnection, "generic");

   XAConnectionFactory xaFactory = (XAConnectionFactory) ic.lookup("/CF_XA_TRUE");
   xaConnection = xaFactory.createXAConnection();
   assertConnectionType(xaConnection, "xa");

   QueueConnectionFactory queueCF = (QueueConnectionFactory) ic.lookup("/CF_QUEUE");
   queueConnection = queueCF.createQueueConnection();
   assertConnectionType(queueConnection, "queue");

   TopicConnectionFactory topicCF = (TopicConnectionFactory) ic.lookup("/CF_TOPIC");
   topicConnection = topicCF.createTopicConnection();
   assertConnectionType(topicConnection, "topic");

   XAQueueConnectionFactory xaQueueCF = (XAQueueConnectionFactory) ic.lookup("/CF_QUEUE_XA_TRUE");
   xaQueueConnection = xaQueueCF.createXAQueueConnection();
   assertConnectionType(xaQueueConnection, "xa-queue");

   XATopicConnectionFactory xaTopicCF = (XATopicConnectionFactory) ic.lookup("/CF_TOPIC_XA_TRUE");
   xaTopicConnection = xaTopicCF.createXATopicConnection();
   assertConnectionType(xaTopicConnection, "xa-topic");

   genericConnection.close();
   xaConnection.close();
   queueConnection.close();
   topicConnection.close();
   xaQueueConnection.close();
   xaTopicConnection.close();

   undeployConnectionFactory("ConnectionFactory");
   undeployConnectionFactory("CF_QUEUE_XA_TRUE");
   undeployConnectionFactory("CF_XA_TRUE");
   undeployConnectionFactory("CF_QUEUE");
   undeployConnectionFactory("CF_TOPIC");
   undeployConnectionFactory("CF_TOPIC_XA_TRUE");
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:55,代码来源:ConnectionFactoryTest.java



注:本文中的javax.jms.XAQueueConnectionFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SubProcessActivityBehavior类代码示例发布时间:2022-05-23
下一篇:
Java ActionResponse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap