Package io.helidon.integrations.jta.weld
Class NarayanaTransactionServices
- java.lang.Object
-
- io.helidon.integrations.jta.weld.NarayanaTransactionServices
-
- All Implemented Interfaces:
Service
,TransactionServices
public final class NarayanaTransactionServices extends Object implements TransactionServices
ATransactionServices
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-inUserTransaction
CDI bean.- See Also:
TransactionServices
-
-
Constructor Summary
Constructors Constructor Description NarayanaTransactionServices()
Deprecated.Only intended for service loader, do not instantiate
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
Releases any internal resources acquired during the lifespan of this object.javax.transaction.UserTransaction
getUserTransaction()
Returns theUserTransaction
present in this environment by invoking theUserTransaction.userTransaction()
method and returning its result.boolean
isTransactionActive()
Returnstrue
if the currentTransaction
has a status indicating that it is active.void
registerSynchronization(javax.transaction.Synchronization synchronization)
Registers the suppliedSynchronization
with the currentTransaction
.
-
-
-
Constructor Detail
-
NarayanaTransactionServices
@Deprecated public NarayanaTransactionServices()
Deprecated.Only intended for service loader, do not instantiateCreates a newNarayanaTransactionServices
.
-
-
Method Detail
-
getUserTransaction
public javax.transaction.UserTransaction 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:
UserTransaction.userTransaction()
-
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:Status.STATUS_ACTIVE
Status.STATUS_COMMITTING
Status.STATUS_MARKED_ROLLBACK
Status.STATUS_PREPARED
Status.STATUS_PREPARING
Status.STATUS_ROLLING_BACK
- 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:
Status
-
registerSynchronization
public void registerSynchronization(javax.transaction.Synchronization synchronization)
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:
Transaction.registerSynchronization(Synchronization)
-
-