public interface LocalTransactionProvider extends TransactionProvider
| Modifier and Type | Field and Description |
|---|---|
static LocalTransactionProvider |
EMPTY
An empty provider which does not support new transactions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commitLocal(Transaction transaction)
Locally commit the given provider transaction.
|
Transaction |
createNewTransaction(int timeout)
Create and start a new local transaction, which is not associated with any particular thread.
|
void |
dropLocal(Transaction transaction)
Drop a local transaction from memory.
|
Object |
getKey(Transaction transaction)
Get a key which has the same equals and hashCode behavior as the given transaction.
|
default String |
getNameFromXid(Xid xid)
Attempt to derive a node name from an XID.
|
String |
getNodeName()
Get the unique node name of this provider.
|
default <T> T |
getProviderInterface(Transaction transaction,
Class<T> providerInterfaceType)
Attempt to acquire a provider interface instance from the given provider transaction.
|
Object |
getResource(Transaction transaction,
Object key)
Get a resource associated with the given transaction.
|
boolean |
getRollbackOnly(Transaction transaction)
Determine if the given transaction is rollback-only.
|
int |
getTimeout(Transaction transaction)
Get the configured timeout of the given transaction (not the remaining time).
|
TransactionManager |
getTransactionManager()
Get the transaction manager.
|
XAImporter |
getXAImporter()
Get the XA importer.
|
Xid |
getXid(Transaction transaction)
Get the transaction ID of the given transaction.
|
boolean |
isImported(Transaction transaction)
Determine whether the given transaction was imported or originated locally.
|
void |
putResource(Transaction transaction,
Object key,
Object value)
Put a resource on to the given transaction.
|
void |
registerInterposedSynchronization(Transaction transaction,
Synchronization sync)
Register an interposed synchronization on the given transaction.
|
void |
rollbackLocal(Transaction transaction)
Locally roll back the given provider transaction.
|
static final LocalTransactionProvider EMPTY
@NotNull TransactionManager getTransactionManager()
null)@NotNull XAImporter getXAImporter()
null)@NotNull Transaction createNewTransaction(int timeout) throws SystemException, SecurityException
timeout - the timeout to use for the new transactionnull)SystemException - if the creation of the transaction failed for some reasonSecurityException - if the caller is not authorized to create a transactionboolean isImported(@NotNull
Transaction transaction)
throws IllegalArgumentException
transaction - the transaction to test (not null)true if the transaction was imported, or false if it was created locallyIllegalArgumentException - if the transaction does not belong to this providervoid registerInterposedSynchronization(@NotNull
Transaction transaction,
@NotNull
Synchronization sync)
throws IllegalArgumentException
transaction - the transaction (not null)sync - the synchronization (not null)IllegalArgumentException - if the transaction does not belong to this providerObject getResource(@NotNull Transaction transaction, @NotNull Object key)
transaction - the transaction (not null)key - the key to look up (not null)null if none is setIllegalArgumentException - if the transaction does not belong to this providervoid putResource(@NotNull
Transaction transaction,
@NotNull
Object key,
Object value)
throws IllegalArgumentException
transaction - the transaction (not null)key - the key to store under (not null)value - the value to storeIllegalArgumentException - if the transaction does not belong to this providerboolean getRollbackOnly(@NotNull
Transaction transaction)
throws IllegalArgumentException
transaction - the transaction (not null)true if the transaction is rollback-only, false otherwiseIllegalArgumentException - if the transaction does not belong to this provider@NotNull Object getKey(@NotNull Transaction transaction) throws IllegalArgumentException
transaction - the transaction (not null)null)IllegalArgumentException - if the transaction does not belong to this providervoid commitLocal(@NotNull
Transaction transaction)
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
SubordinateTransactionControl.commit(boolean).transaction - the transaction (not null)RollbackException - if the local commit operation throws this exceptionHeuristicMixedException - if the local commit operation throws this exceptionHeuristicRollbackException - if the local commit operation throws this exceptionSecurityException - if the local commit operation throws this exceptionIllegalStateException - if the local commit operation throws this exceptionSystemException - if the local commit operation throws this exceptionvoid rollbackLocal(@NotNull
Transaction transaction)
throws IllegalStateException,
SystemException
SubordinateTransactionControl.rollback().transaction - the transaction (not null)IllegalStateException - if the local commit operation throws this exceptionSystemException - if the local commit operation throws this exceptionvoid dropLocal(@NotNull
Transaction transaction)
transaction - the transaction to drop (not null)int getTimeout(@NotNull
Transaction transaction)
transaction - the transaction (not null)@NotNull Xid getXid(@NotNull Transaction transaction)
transaction - the transaction (not null)null)@NotNull String getNodeName()
null)default String getNameFromXid(@NotNull Xid xid)
null is returned.xid - the XID (not null)default <T> T getProviderInterface(Transaction transaction, Class<T> providerInterfaceType)
T - the provider interface typetransaction - the provider transaction (not null)providerInterfaceType - the provider interface type class (not null)null if none matchesCopyright © 2017 JBoss by Red Hat. All rights reserved.