类 SimpleTransactionFactory
- java.lang.Object
- org.springframework.transaction.jta.SimpleTransactionFactory
- 所有已实现的接口:
TransactionFactory
public class SimpleTransactionFactory extends Object implements TransactionFactory
Default implementation of theTransactionFactory
strategy interface, simply wrapping a standard JTATransactionManager
.Does not support transaction names; simply ignores any specified name.
- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
TransactionManager.setTransactionTimeout(int)
,TransactionManager.begin()
,TransactionManager.getTransaction()
构造器概要
构造器 构造器 说明 SimpleTransactionFactory(TransactionManager transactionManager)
Create a new SimpleTransactionFactory for the given TransactionManager
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Transaction
createTransaction(String name, int timeout)
Create an active Transaction object based on the given name and timeout.boolean
supportsResourceAdapterManagedTransactions()
Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).
构造器详细资料
SimpleTransactionFactory
public SimpleTransactionFactory(TransactionManager transactionManager)
Create a new SimpleTransactionFactory for the given TransactionManager- 参数:
transactionManager
- the JTA TransactionManager to wrap
方法详细资料
createTransaction
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException
从接口复制的说明:TransactionFactory
Create an active Transaction object based on the given name and timeout.- 指定者:
createTransaction
在接口中TransactionFactory
- 参数:
name
- the transaction name (may benull
)timeout
- the transaction timeout (may be -1 for the default timeout)- 返回:
- the active Transaction object (never
null
) - 抛出:
NotSupportedException
- if the transaction manager does not support a transaction of the specified typeSystemException
- if the transaction manager failed to create the transaction
supportsResourceAdapterManagedTransactions
public boolean supportsResourceAdapterManagedTransactions()
从接口复制的说明:TransactionFactory
Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).Typically
false
. Checked byAbstractMessageEndpointFactory
in order to differentiate between invalid configuration and valid ResourceAdapter-managed transactions.