public final class JBossLocalTransactionProvider extends Object implements LocalTransactionProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
JBossLocalTransactionProvider.Builder
A builder for a JBoss local transaction provider.
|
EMPTY| Modifier and Type | Method and Description |
|---|---|
static JBossLocalTransactionProvider.Builder |
builder() |
Transaction |
createNewTransaction(int timeout)
Create and start a new local transaction, which is not associated with any particular thread.
|
Object |
getKey(Transaction transaction)
Get a key which has the same equals and hashCode behavior as the given transaction.
|
String |
getNameFromXid(Xid xid)
Attempt to derive a node name from an XID.
|
String |
getNodeName()
Get the unique node name of this provider.
|
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.
|
TransactionManager |
getTransactionManager()
Get the transaction manager.
|
XAImporter |
getXAImporter()
Get the XA importer.
|
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.
|
public static JBossLocalTransactionProvider.Builder builder()
@NotNull public TransactionManager getTransactionManager()
LocalTransactionProvidergetTransactionManager in interface LocalTransactionProvidernull)@NotNull public XAImporter getXAImporter()
LocalTransactionProvidergetXAImporter in interface LocalTransactionProvidernull)@NotNull public Transaction createNewTransaction(int timeout) throws SystemException, SecurityException
LocalTransactionProvidercreateNewTransaction in interface LocalTransactionProvidertimeout - 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 transactionpublic boolean isImported(@NotNull
Transaction transaction)
throws IllegalArgumentException
LocalTransactionProviderisImported in interface LocalTransactionProvidertransaction - 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 providerpublic void registerInterposedSynchronization(@NotNull
Transaction transaction,
@NotNull
Synchronization sync)
throws IllegalArgumentException
LocalTransactionProviderregisterInterposedSynchronization in interface LocalTransactionProvidertransaction - the transaction (not null)sync - the synchronization (not null)IllegalArgumentException - if the transaction does not belong to this providerpublic Object getResource(@NotNull Transaction transaction, @NotNull Object key)
LocalTransactionProvidergetResource in interface LocalTransactionProvidertransaction - the transaction (not null)key - the key to look up (not null)null if none is setpublic void putResource(@NotNull
Transaction transaction,
@NotNull
Object key,
Object value)
throws IllegalArgumentException
LocalTransactionProviderputResource in interface LocalTransactionProvidertransaction - 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 providerpublic boolean getRollbackOnly(@NotNull
Transaction transaction)
throws IllegalArgumentException
LocalTransactionProvidergetRollbackOnly in interface LocalTransactionProvidertransaction - the transaction (not null)true if the transaction is rollback-only, false otherwiseIllegalArgumentException - if the transaction does not belong to this provider@NotNull public Object getKey(@NotNull Transaction transaction) throws IllegalArgumentException
LocalTransactionProvidergetKey in interface LocalTransactionProvidertransaction - the transaction (not null)null)IllegalArgumentException - if the transaction does not belong to this provider@NotNull public String getNodeName()
LocalTransactionProvidergetNodeName in interface LocalTransactionProvidernull)public String getNameFromXid(@NotNull Xid xid)
LocalTransactionProvidernull is returned.getNameFromXid in interface LocalTransactionProviderxid - the XID (not null)Copyright © 2017 JBoss by Red Hat. All rights reserved.