本文整理汇总了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;未经允许,请勿转载。 |
请发表评论