XAConnectionFactory (Java EE 5)

Java EE API


javax.jms Interface XAConnectionFactory

All Known Subinterfaces:
XAQueueConnectionFactory, XATopicConnectionFactory

public interface XAConnectionFactory


XAConnectionFactory 接口是 XAQueueConnectionFactoryXATopicConnectionFactory 接口的基接口。

某些应用服务器支持将具有 JTS 功能的资源使用分组成分布式事务(可选)。要在 JTS 事务中包含 JMS API 事务,应用服务器需要 JTS 感知的 JMS 提供者。JMS 提供者使用 XAConnectionFactory 对象公开其 JTS 支持,应用服务器使用该对象创建 XAConnection 对象。

XAConnectionFactory 对象是 JMS 管理对象,就像 ConnectionFactory 对象一样。根据预期应用服务器将使用 Java Naming and Directory Interface (JNDI) API 查找这些对象。

XAConnectionFactory 接口是可选的。JMS 提供者不需要支持此接口。此接口供 JMS 提供者使用,以支持事务环境。强烈建议客户端程序使用其环境中可用的事务支持,而不是直接使用这些 XA 接口。

英文文档:

The XAConnectionFactory interface is a base interface for the XAQueueConnectionFactory and XATopicConnectionFactory interfaces.

Some application servers provide support for grouping JTS capable resource use into a distributed transaction (optional). To include JMS API transactions in a JTS transaction, an application server requires a JTS aware JMS provider. A JMS provider exposes its JTS support using an XAConnectionFactory object, which an application server uses to create XAConnection objects.

XAConnectionFactory objects are JMS administered objects, just like ConnectionFactory objects. It is expected that application servers will find them using the Java Naming and Directory Interface (JNDI) API.

The XAConnectionFactory 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.

Version:
1.1 April 4, 2002
Author:
Mark Hapner, Rich Burridge, Kate Stout
See Also:
XAQueueConnectionFactory, XATopicConnectionFactory

Method Summary
 XAConnection
 XAConnection
 

Method Detail

public XAConnection createXAConnection() throws JMSException
创建带有默认用户身份的 XAConnection。以停止模式创建连接。在显式调用 Connection.start 方法前,不会传送任何消息。
return 新建的 XAConnection
ThrowsJMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 连接。
ThrowsJMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
since1.1
英文文档:

createXAConnection

XAConnection createXAConnection()
                                throws JMSException
Creates an XAConnection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Returns:
a newly created XAConnection
Throws:
JMSException - if the JMS provider fails to create an XA connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Since:
1.1

public XAConnection createXAConnection(String userName, String password) throws JMSException
创建带有指定用户身份的 XA 连接。以停止模式创建连接。在显式调用 Connection.start 方法前,不会传送任何消息。
userName 调用者的用户名
password 调用者的密码
return 新建的 XA 连接
ThrowsJMSException: 如果 JMS 提供者由于某个内部错误无法创建 XA 连接。
ThrowsJMSSecurityException: 如果客户端验证由于无效用户名或密码失败。
since1.1
英文文档:

createXAConnection

XAConnection createXAConnection(String userName,
                                String password)
                                throws JMSException
Creates an XA connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created XA connection
Throws:
JMSException - if the JMS provider fails to create an XA connection due to some internal error.
JMSSecurityException - if client authentication fails due to an invalid user name or password.
Since:
1.1


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!