Package io.helidon.integrations.jta.weld
Class NarayanaTransactionServices
java.lang.Object
io.helidon.integrations.jta.weld.NarayanaTransactionServices
- All Implemented Interfaces:
Service
,TransactionServices
A
TransactionServices
implementation that uses the Narayana transaction
engine and does not use JNDI.
TransactionServices
implementations are used by Weld for transactional observer notification as well as
for providing the implementation backing the built-in UserTransaction
CDI bean.
- See Also:
-
Constructor Summary
ConstructorDescriptionDeprecated.Only intended for service loader, do not instantiate -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Releases any internal resources acquired during the lifespan of this object.Returns theUserTransaction
present in this environment by invoking theUserTransaction.userTransaction()
method and returning its result.boolean
void
registerSynchronization
(Synchronization synchronization) Registers the suppliedSynchronization
with the currentTransaction
.
-
Constructor Details
-
NarayanaTransactionServices
Deprecated.Only intended for service loader, do not instantiateCreates a newNarayanaTransactionServices
.
-
-
Method Details
-
getUserTransaction
Returns theUserTransaction
present in this environment by invoking theUserTransaction.userTransaction()
method and returning its result.This method never returns
null
.The return value of this method is used as the backing implementation of the built-in
UserTransaction
CDI bean.- Specified by:
getUserTransaction
in interfaceTransactionServices
- Returns:
- the non-
null
UserTransaction
present in this environment - See Also:
-
isTransactionActive
public boolean isTransactionActive()Returnstrue
if the currentTransaction
has a status indicating that it is active.This method returns
true
if the currentTransaction
has a status equal to one of the following values:- Specified by:
isTransactionActive
in interfaceTransactionServices
- Returns:
true
if the currentTransaction
has a status indicating that it is active;false
otherwise- Throws:
RuntimeException
- if an invocation of theTransaction.getStatus()
method resulted in aSystemException
- See Also:
-
registerSynchronization
Registers the suppliedSynchronization
with the currentTransaction
.- Specified by:
registerSynchronization
in interfaceTransactionServices
- Throws:
RuntimeException
- if an invocation of theTransactionManager.getTransaction()
method resulted in aSystemException
, or if an invocation of theTransaction.registerSynchronization(Synchronization)
method resulted in either aSystemException
or aRollbackException
- See Also:
-
cleanup
public void cleanup()Releases any internal resources acquired during the lifespan of this object.
-