Class JBossContextXATerminator
- All Implemented Interfaces:
jakarta.resource.spi.XATerminator,org.jboss.tm.JBossXATerminator
-
Constructor Summary
ConstructorsConstructorDescriptionJBossContextXATerminator(org.wildfly.transaction.client.LocalTransactionContext transactionContext, org.jboss.tm.JBossXATerminator jbossXATerminator) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelWork(jakarta.resource.spi.work.Work work, Xid xid) CallingJBossXATerminatorto cancel the work for us.voidvoidSuspending transaction and canceling the work.voidintXid[]recover(int flag) voidregisterWork(jakarta.resource.spi.work.Work work, Xid xid, long timeout) Interception of register work call to get transaction being imported to wildfly transacton client.voidvoidStart work gets imported transaction and assign it to current thread.
-
Constructor Details
-
JBossContextXATerminator
public JBossContextXATerminator(org.wildfly.transaction.client.LocalTransactionContext transactionContext, org.jboss.tm.JBossXATerminator jbossXATerminator)
-
-
Method Details
-
commit
- Specified by:
commitin interfacejakarta.resource.spi.XATerminator- Throws:
XAException
-
forget
- Specified by:
forgetin interfacejakarta.resource.spi.XATerminator- Throws:
XAException
-
prepare
- Specified by:
preparein interfacejakarta.resource.spi.XATerminator- Throws:
XAException
-
recover
- Specified by:
recoverin interfacejakarta.resource.spi.XATerminator- Throws:
XAException
-
rollback
- Specified by:
rollbackin interfacejakarta.resource.spi.XATerminator- Throws:
XAException
-
registerWork
public void registerWork(jakarta.resource.spi.work.Work work, Xid xid, long timeout) throws jakarta.resource.spi.work.WorkCompletedException Interception of register work call to get transaction being imported to wildfly transacton client.
For importing a transaction Wildfly transaction client eventually calls
SubordinationManageras NarayanaXATerminators do. This wrapping then let wildfly transacton client to register the transaction for itself, wildfly transacton client then import transaction to Narayana too and finally this method uses Narayana'sXATerminatorto register allWorks binding.
Narayana'sXATerminatortries to import transaction too but as transaction is already imported it just gets instance of transaction already imported via call of wildfly transacton client.- Specified by:
registerWorkin interfaceorg.jboss.tm.JBossXATerminator- Throws:
jakarta.resource.spi.work.WorkCompletedException
-
startWork
public void startWork(jakarta.resource.spi.work.Work work, Xid xid) throws jakarta.resource.spi.work.WorkCompletedException Start work gets imported transaction and assign it to current thread.
This method mimics behavior of Narayana's
JBossXATerminator.- Specified by:
startWorkin interfaceorg.jboss.tm.JBossXATerminator- Throws:
jakarta.resource.spi.work.WorkCompletedException
-
endWork
Suspending transaction and canceling the work.
Suspend transaction has to be called on the wildfly transaction manager and the we delegate work cancellation to
JBossXATerminator.
First we have to cancel the work for jboss terminator would not work with suspended transaction.- Specified by:
endWorkin interfaceorg.jboss.tm.JBossXATerminator
-
cancelWork
Calling
JBossXATerminatorto cancel the work for us.There should not be need any action to be processed by wildfly transaction client.
- Specified by:
cancelWorkin interfaceorg.jboss.tm.JBossXATerminator
-