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() |
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.
|
String |
getNameFromXid(Xid xid)
Attempt to derive a node name from an XID.
|
String |
getNodeName()
Get the unique node name of this provider.
|
<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.
|
String |
toString() |
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 providerpublic void commitLocal(@NotNull
Transaction transaction)
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
LocalTransactionProviderSubordinateTransactionControl.commit(boolean).commitLocal in interface LocalTransactionProvidertransaction - 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 exceptionpublic void rollbackLocal(@NotNull
Transaction transaction)
throws IllegalStateException,
SystemException
LocalTransactionProviderSubordinateTransactionControl.rollback().rollbackLocal in interface LocalTransactionProvidertransaction - the transaction (not null)IllegalStateException - if the local commit operation throws this exceptionSystemException - if the local commit operation throws this exceptionpublic void dropLocal(@NotNull
Transaction transaction)
LocalTransactionProviderdropLocal in interface LocalTransactionProvidertransaction - the transaction to drop (not null)public int getTimeout(@NotNull
Transaction transaction)
LocalTransactionProvidergetTimeout in interface LocalTransactionProvidertransaction - the transaction (not null)@NotNull public Xid getXid(@NotNull Transaction transaction)
LocalTransactionProvidergetXid in interface LocalTransactionProvidertransaction - the transaction (not null)null)@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)public <T> T getProviderInterface(Transaction transaction, Class<T> providerInterfaceType)
LocalTransactionProvidergetProviderInterface in interface LocalTransactionProviderT - 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.