本文整理了Java中javax.jms.XATopicConnection
类的一些代码示例,展示了XATopicConnection
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XATopicConnection
类的具体详情如下:
包路径:javax.jms.XATopicConnection
类名称:XATopicConnection
[英]An XATopicConnection provides the same create options as TopicConnection (optional). The Topic connections created are transactional.
The XATopicConnection interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.
[中]XATopicConnection提供与TopicConnection相同的创建选项(可选)。创建的主题连接是事务性的。
XATopicConnection接口是可选的。JMS提供程序不需要支持此接口。此接口供JMS提供程序用于支持事务性环境。强烈建议客户端程序使用其环境中可用的事务支持,而不是直接使用这些XA接口。
代码示例来源:origin: openzipkin/brave
@Override public XATopicSession createXATopicSession() throws JMSException {
if ((types & TYPE_XA_TOPIC) != TYPE_XA_TOPIC) {
throw new IllegalStateException(delegate + " is not an XATopicConnection");
}
XATopicSession xats = ((XATopicConnection) delegate).createXATopicSession();
return TracingXASession.create(xats, jmsTracing);
}
}
代码示例来源:origin: org.objectweb.jonas/jonas-ejb-container
if (tconn != null) {
if (mdd.isRequired()) {
sess = tconn.createXATopicSession();
} else {
sess = tconn.createTopicSession(false, mdd.getAcknowledgeMode());
代码示例来源:origin: org.objectweb.jonas/jonas-ejb-container
TraceEjb.mdb.log(BasicLevel.DEBUG, "createDurableConnectionConsumer for " + ejbname);
cc = tconn.createDurableConnectionConsumer(t, ejbname, selector, this, maxMessages);
} else {
if (TraceEjb.isDebugJms()) {
TraceEjb.mdb.log(BasicLevel.DEBUG, "createConnectionConsumer for " + dest);
cc = tconn.createConnectionConsumer(t, selector, this, maxMessages);
tconn.start();
} else {
代码示例来源:origin: org.objectweb.jonas/jonas-ejb-container
/**
* stop this EJB.
* call ejbRemove on all MDB
* close the connection consumer
* Stop the threads and remove the beans
*/
public void stop() {
if (TraceEjb.isDebugJms()) {
TraceEjb.mdb.log(BasicLevel.DEBUG, "");
}
try {
cc.close();
if (tconn != null) {
tconn.close();
}
if (qconn != null) {
qconn.close();
}
} catch (JMSException e) {
TraceEjb.logger.log(BasicLevel.WARN, "unregister: Cannot close Connection Consumer");
}
stopContainer();
}
代码示例来源:origin: org.objectweb.jonas/jonas-jms-manager
/**
* @throws JMSException - if JMS Connection fails to create a ConnectionConsumer
*/
public ConnectionConsumer createConnectionConsumer(Topic topic,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages) throws JMSException {
TraceJms.logger.log(BasicLevel.DEBUG, "");
return xatc.createConnectionConsumer(topic, messageSelector, sessionPool, maxMessages);
}
}
代码示例来源:origin: org.objectweb.jonas/jonas-jms-manager
ts = xatc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
jconn.sessionOpen(this);
} else {
if (xats == null) {
xats = xatc.createXATopicSession();
if (currtx != null) {
TraceJms.logger.log(BasicLevel.ERROR,"mixed transactions");
代码示例来源:origin: apache/activemq-artemis
topicConnection.close();
xaQueueConnection.close();
xaTopicConnection.close();
代码示例来源:origin: com.axway.ats.framework/ats-actionlibrary
@Override
public XATopicSession createXATopicSession() throws JMSException {
return addSession( ((XATopicConnection) connection).createXATopicSession());
}
}
代码示例来源:origin: com.axway.ats.framework/ats-actionlibrary
@Override
public XATopicSession createXATopicSession() throws JMSException {
return addSession(xaTopicConnection.createXATopicSession());
}
}
代码示例来源:origin: org.wso2.transport.jms/transport-jms
/**
* Create JMS {@link XASession} instance on top of the provided {@link Connection} instance.
*
* @param xAConnection JMS Connection.
* @return Session instance.
* @throws JMSConnectorException Error when creating the XASession.
*/
public XASession createXASession(XAConnection xAConnection) throws JMSConnectorException {
try {
if (logger.isDebugEnabled()) {
logger.debug("Creating a new JMS XASession on: " + this.connectionFactoryString);
}
if (JMSConstants.JMS_SPEC_VERSION_1_1.equals(jmsSpec) || JMSConstants.JMS_SPEC_VERSION_2_0
.equals(jmsSpec)) {
return xAConnection.createXASession();
} else if (JMSConstants.JMSDestinationType.QUEUE.equals(this.destinationType)) {
return ((XAQueueConnection) (xAConnection)).createXAQueueSession();
} else {
return ((XATopicConnection) (xAConnection)).createXATopicSession();
}
} catch (JMSException e) {
throw new JMSConnectorException(
"JMS Exception while obtaining session for factory " + connectionFactoryString, e);
}
}
代码示例来源:origin: org.wso2.carbon.transport/org.wso2.carbon.transport.jms
/**
* Create JMS {@link XASession} instance on top of the provided {@link Connection} instance.
*
* @param xAConnection JMS Connection.
* @return Session instance.
* @throws JMSConnectorException Error when creating the XASession.
*/
public XASession createXASession(XAConnection xAConnection) throws JMSConnectorException {
try {
if (logger.isDebugEnabled()) {
logger.debug("Creating a new JMS XASession on: " + this.connectionFactoryString);
}
if (JMSConstants.JMS_SPEC_VERSION_1_1.equals(jmsSpec) || JMSConstants.JMS_SPEC_VERSION_2_0
.equals(jmsSpec)) {
return xAConnection.createXASession();
} else if (JMSConstants.JMSDestinationType.QUEUE.equals(this.destinationType)) {
return ((XAQueueConnection) (xAConnection)).createXAQueueSession();
} else {
return ((XATopicConnection) (xAConnection)).createXATopicSession();
}
} catch (JMSException e) {
throw new JMSConnectorException(
"JMS Exception while obtaining session for factory " + connectionFactoryString, e);
}
}
代码示例来源:origin: org.jboss.genericjms/generic-jms-ra-jar
session = ((XAQueueSession)xaSession).getQueueSession();
} else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
xaSession = ((XATopicConnection) con).createXATopicSession();
session = ((XATopicSession)xaSession).getTopicSession();
} else {
代码示例来源:origin: org.jboss.jbossas/jboss-as-connector
xaTopicSession = ((XATopicConnection)con).createXATopicSession();
topicSession = xaTopicSession.getTopicSession();
xaTransacted = true;
代码示例来源:origin: org.apache.qpid/qpid-jca
_xaSession = ((XATopicConnection)_connection).createXATopicSession();
_session = ((TopicConnection)_connection).createTopicSession(transacted, acknowledgeMode);
内容来源于网络,如有侵权,请联系作者删除!