Package com.jsgalactic.axiom.jta.spi
Interface JtaTransactionLookup
- All Known Implementing Classes:
Jta,JtaLookupService
public interface JtaTransactionLookup
A read-only view of the JTA transaction bound to a request, with only JDK types in its
signatures.
This is the integration point for modules such as a JPA adapter that need to know whether the
current request has an active JTA transaction. Such a module does not need a compile dependency
on axiom-jta: it can load this interface by name from ServiceLoader and call its
three methods reflectively, because the arguments and results are Object, String
and boolean. The implementation shipped by axiom-jta is registered as a service
and consults every Jta instance built in this class loader, keyed by the request's
context object. It never starts, completes or mutates a transaction.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReports whether a transaction is currently associated with the request represented bycontext.booleanrollbackOnly(Object context) Reports whether the request's active transaction has been marked rollback-only.Returns the request's transaction status as a plain name:ACTIVE,MARKED_ROLLBACK,COMMITTED,ROLLED_BACK,INACTIVEorUNKNOWN.
-
Method Details
-
active
Reports whether a transaction is currently associated with the request represented bycontext.- Parameters:
context- the request's Axiom context, or any object to answerfalse- Returns:
- true while a transaction is active for that request
-
status
Returns the request's transaction status as a plain name:ACTIVE,MARKED_ROLLBACK,COMMITTED,ROLLED_BACK,INACTIVEorUNKNOWN.- Parameters:
context- the request's Axiom context- Returns:
- one of the six status names
-
rollbackOnly
Reports whether the request's active transaction has been marked rollback-only.- Parameters:
context- the request's Axiom context- Returns:
- true when rollback-only was set by the handler or the provider
-