public class SimpleTransactionFactory extends java.lang.Object implements TransactionFactory
TransactionFactory
strategy interface,
simply wrapping a standard JTA TransactionManager
.
Does not support transaction names; simply ignores any specified name.
TransactionManager.setTransactionTimeout(int)
,
TransactionManager.begin()
,
TransactionManager.getTransaction()
Constructor and Description |
---|
SimpleTransactionFactory(javax.transaction.TransactionManager transactionManager)
Create a new SimpleTransactionFactory for the given TransactionManager
|
Modifier and Type | Method and Description |
---|---|
javax.transaction.Transaction |
createTransaction(java.lang.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.
|
public SimpleTransactionFactory(javax.transaction.TransactionManager transactionManager)
transactionManager
- the JTA TransactionManager to wrappublic javax.transaction.Transaction createTransaction(java.lang.String name, int timeout) throws javax.transaction.NotSupportedException, javax.transaction.SystemException
TransactionFactory
createTransaction
in interface TransactionFactory
name
- the transaction name (may be null
)timeout
- the transaction timeout (may be -1 for the default timeout)null
)javax.transaction.NotSupportedException
- if the transaction manager does not support
a transaction of the specified typejavax.transaction.SystemException
- if the transaction manager failed to create the
transactionpublic boolean supportsResourceAdapterManagedTransactions()
TransactionFactory
Typically false
. Checked by
AbstractMessageEndpointFactory
in order to differentiate between invalid configuration and valid
ResourceAdapter-managed transactions.
supportsResourceAdapterManagedTransactions
in interface TransactionFactory
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
,
MessageEndpointFactory.isDeliveryTransacted(java.lang.reflect.Method)
Copyright © 2021. All rights reserved.