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
ATransactionServicesimplementation that uses the Narayana transaction engine and does not use JNDI.TransactionServicesimplementations are used by Weld for transactional observer notification as well as for providing the implementation backing the built-inUserTransactionCDI 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 voidcleanup()Releases any internal resources acquired during the lifespan of this object.javax.transaction.UserTransactiongetUserTransaction()Returns theUserTransactionpresent in this environment by invoking theUserTransaction.userTransaction()method and returning its result.booleanisTransactionActive()Returnstrueif the currentTransactionhas a status indicating that it is active.voidregisterSynchronization(javax.transaction.Synchronization synchronization)Registers the suppliedSynchronizationwith 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 theUserTransactionpresent 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
UserTransactionCDI bean.- Specified by:
getUserTransactionin interfaceTransactionServices- Returns:
- the non-
nullUserTransactionpresent in this environment - See Also:
UserTransaction.userTransaction()
-
isTransactionActive
public boolean isTransactionActive()
Returnstrueif the currentTransactionhas a status indicating that it is active.This method returns
trueif the currentTransactionhas a status equal to one of the following values:Status.STATUS_ACTIVEStatus.STATUS_COMMITTINGStatus.STATUS_MARKED_ROLLBACKStatus.STATUS_PREPAREDStatus.STATUS_PREPARINGStatus.STATUS_ROLLING_BACK
- Specified by:
isTransactionActivein interfaceTransactionServices- Returns:
trueif the currentTransactionhas a status indicating that it is active;falseotherwise- 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 suppliedSynchronizationwith the currentTransaction.- Specified by:
registerSynchronizationin 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 aSystemExceptionor aRollbackException- See Also:
Transaction.registerSynchronization(Synchronization)
-
-