public abstract class TransactionSupportUtil extends Object
TransactionSynchronization
instances
are registered on behalf of the application code.Modifier and Type | Field and Description |
---|---|
protected static String |
RESOURCE_KEY_TXN_COMPLETING
resource binding during after-completion phase
|
protected static String |
RESOURCE_KEY_TXN_SYNCH
resource key to store the transaction synchronizer instance
|
static int |
SESSION_SYNCHRONIZATION_ORDER
The order of synchronization set to be 100 less than the Hibernate synchronization order
|
Constructor and Description |
---|
TransactionSupportUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
bindListener(TransactionListener listener,
int priority)
Bind listener to the specified priority.
|
static void |
bindResource(Object key,
Object resource)
Binds a resource to the current transaction, which must be active.
|
static Set<TransactionListener> |
getListeners() |
static <R> R |
getResource(Object key)
Gets a resource associated with the current transaction, which must be active.
|
static String |
getTransactionId()
Get a unique identifier associated with each transaction of each thread.
|
static long |
getTransactionStartTime() |
static boolean |
isActualTransactionActive() |
static void |
unbindResource(Object key)
Unbinds a resource from the current transaction, which must be active.
|
public static final int SESSION_SYNCHRONIZATION_ORDER
protected static final String RESOURCE_KEY_TXN_SYNCH
protected static final String RESOURCE_KEY_TXN_COMPLETING
public static long getTransactionStartTime()
public static String getTransactionId()
public static boolean isActualTransactionActive()
public static <R> R getResource(Object key)
All necessary synchronization instances will be registered automatically, if required.
key
- the thread resource map keyfor helper methods to create and bind common collection types
public static void bindResource(Object key, Object resource)
All necessary synchronization instances will be registered automatically, if required.
key
- Objectresource
- Objectpublic static void unbindResource(Object key)
All necessary synchronization instances will be registered automatically, if required.
key
- Objectpublic static boolean bindListener(TransactionListener listener, int priority)
listener
- the listener to bind.priority
- 0 = Normal prioritypublic static Set<TransactionListener> getListeners()
Copyright © 2005–2019 Alfresco Software. All rights reserved.