org.springframework.transaction.jta
Class SimpleTransactionFactory
java.lang.Object
org.springframework.transaction.jta.SimpleTransactionFactory
- All Implemented Interfaces:
- TransactionFactory
public class SimpleTransactionFactory
- extends java.lang.Object
- implements TransactionFactory
Default implementation of the TransactionFactory
strategy interface,
simply wrapping a standard JTA TransactionManager
.
Does not support transaction names; simply ignores any specified name.
- Since:
- 2.5
- Author:
- Juergen Hoeller
- See Also:
TransactionManager.setTransactionTimeout(int)
,
TransactionManager.begin()
,
TransactionManager.getTransaction()
Constructor Summary |
SimpleTransactionFactory(javax.transaction.TransactionManager transactionManager)
Create a new SimpleTransactionFactory for the given TransactionManager |
Method Summary |
javax.transaction.Transaction |
createTransaction(java.lang.String name,
int timeout)
Create an active Transaction object based on the given name and timeout. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleTransactionFactory
public SimpleTransactionFactory(javax.transaction.TransactionManager transactionManager)
- Create a new SimpleTransactionFactory for the given TransactionManager
- Parameters:
transactionManager
- the JTA TransactionManager to wrap
createTransaction
public javax.transaction.Transaction createTransaction(java.lang.String name,
int timeout)
throws javax.transaction.NotSupportedException,
javax.transaction.SystemException
- Description copied from interface:
TransactionFactory
- Create an active Transaction object based on the given name and timeout.
- Specified by:
createTransaction
in interface TransactionFactory
- Parameters:
name
- the transaction name (may be null
)timeout
- the transaction timeout (may be -1 for the default timeout)
- Returns:
- the active Transaction object (never
null
)
- Throws:
javax.transaction.NotSupportedException
- if the transaction manager does not support
a transaction of the specified type
javax.transaction.SystemException
- if the transaction managed failed to create the
transaction
Copyright © 2002-2008 The Spring Framework.