Class XATerminator

All Implemented Interfaces:
XATerminatorExtensions, jakarta.resource.spi.XATerminator, org.jboss.tm.ExtendedJBossXATerminator, org.jboss.tm.JBossXATerminator

public class XATerminator extends XATerminatorImple implements org.jboss.tm.JBossXATerminator
The implementation of JBossXATerminator using the purely local (ArjunaCore) implementation of the JTA. The JBossXATerminator is the way in JBoss 4.x for adding work to an inflowed transaction. JCA 1.5 has the concept of a WorkManager.
Author:
mcl
  • Constructor Details

    • XATerminator

      public XATerminator()
  • Method Details

    • registerWork

      public void registerWork(jakarta.resource.spi.work.Work work, Xid xid, long timeout) throws jakarta.resource.spi.work.WorkCompletedException
      Register the unit of work with the specified transaction. The thread-to-transaction association is not changed yet. Basically this operation only lets the transaction system know about the work and nothing else.
      Specified by:
      registerWork in interface org.jboss.tm.JBossXATerminator
      Parameters:
      work - the work to associate with the transaction.
      xid - the transaction within which the work will be performed.
      timeout - the lifetime of the transaction.
      Throws:
      jakarta.resource.spi.work.WorkCompletedException - thrown if the work cannot be associated with the transaction.
    • startWork

      public void startWork(jakarta.resource.spi.work.Work work, Xid xid) throws jakarta.resource.spi.work.WorkCompletedException
      Associate the current thread with the specified transaction. In JBoss 4.x, they assume that the work has already been registered, so we do likewise, i.e., we don't do a register if it hasn't, but we will throw an exception (which is more than JBoss does).
      Specified by:
      startWork in interface org.jboss.tm.JBossXATerminator
      Parameters:
      work - the Work to start
      xid - the transaction to associate with the current thread.
      Throws:
      jakarta.resource.spi.work.WorkCompletedException - thrown if there are any errors.
    • endWork

      public void endWork(jakarta.resource.spi.work.Work work, Xid xid)
      Disassociate the thread from the transaction and remove the work from the transaction pool of workers. This assumes that the invoking thread is the one doing the work.
      Specified by:
      endWork in interface org.jboss.tm.JBossXATerminator
      Parameters:
      work - the Work unit to remove.
      xid - the transaction to remove the work from.
    • cancelWork

      public void cancelWork(jakarta.resource.spi.work.Work work, Xid xid)
      Remove the associated work from the transaction. Do not do any thread-to-transaction disassociation.
      Specified by:
      cancelWork in interface org.jboss.tm.JBossXATerminator
      Parameters:
      work - the unit of work to remove.
      xid - the transaction from which it should be disassociated.