public interface TransactionSynchronizationRegistry
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getResource(java.lang.Object key)
Get a transaction local for the current transaction
|
boolean |
getRollbackOnly()
Get the rollback status of the transaction associated with the
current thread.
|
java.lang.Object |
getTransactionKey()
An object that has the same equals/hashCode behaviour
as the transaction currently associated with the thread
|
int |
getTransactionStatus()
Get the transaction status of the current thread
|
void |
putResource(java.lang.Object key,
java.lang.Object value)
Set a transaction local for the current transaction
|
void |
registerInterposedSynchronization(Synchronization sync)
Add a transaction synchronization that is invoked "last",
i.e.
|
void |
setRollbackOnly()
Set the transaction associated with the current thread to force a rollback
|
java.lang.Object getTransactionKey()
int getTransactionStatus()
boolean getRollbackOnly() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if there is no current transactionvoid setRollbackOnly() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if there is no current transactionvoid registerInterposedSynchronization(Synchronization sync) throws java.lang.IllegalStateException
The beforeCompletion is invoked in the context of the transaction, the afterCompletion in an undefined transaction context. Other context is the same as when the one used to register the synchronization.
Access to "user components" is not allowed, e.g. ejb bean methods.
Access to other resources, e.g. jca, is allowed in the beforeCompletion, but not transactional work is allowed in the afterCompletion. e.g. typically only "close()" is allowed.
sync
- the synchronizationjava.lang.IllegalStateException
- if there is no current transactionjava.lang.Object getResource(java.lang.Object key) throws java.lang.IllegalStateException
key
- the key to the valuejava.lang.IllegalStateException
- if there is no current transactionjava.lang.NullPointerException
- if the key is nullvoid putResource(java.lang.Object key, java.lang.Object value) throws java.lang.IllegalStateException
key
- the key to the valuevalue
- the valuejava.lang.IllegalStateException
- if there is no current transactionjava.lang.NullPointerException
- if the key is null