Class XATerminator

  • All Implemented Interfaces:
    com.arjuna.ats.internal.jta.resources.spi.XATerminatorExtensions, javax.resource.spi.XATerminator, org.jboss.tm.ExtendedJBossXATerminator, org.jboss.tm.JBossXATerminator

    public class XATerminator
    extends com.arjuna.ats.internal.jta.transaction.arjunacore.jca.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 Summary

      Constructors 
      Constructor Description
      XATerminator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancelWork​(javax.resource.spi.work.Work work, Xid xid)
      Remove the associated work from the transaction.
      void endWork​(javax.resource.spi.work.Work work, Xid xid)
      Disassociate the thread from the transaction and remove the work from the transaction pool of workers.
      void registerWork​(javax.resource.spi.work.Work work, Xid xid, long timeout)
      Register the unit of work with the specified transaction.
      void startWork​(javax.resource.spi.work.Work work, Xid xid)
      Associate the current thread with the specified transaction.
      • Methods inherited from class com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple

        beforeCompletion, commit, doRecover, forget, getCurrentTransactionId, getImportedTransaction, getTransaction, getTransactionById, getXidsToRecoverForParentNode, importTransaction, isRecoveryByNodeOrXidSupported, prepare, recover, removeImportedTransaction, rollback
      • Methods inherited from interface javax.resource.spi.XATerminator

        commit, forget, prepare, recover, rollback
    • Constructor Detail

      • XATerminator

        public XATerminator()
    • Method Detail

      • registerWork

        public void registerWork​(javax.resource.spi.work.Work work,
                                 Xid xid,
                                 long timeout)
                          throws javax.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:
        javax.resource.spi.work.WorkCompletedException - thrown if the work cannot be associated with the transaction.
      • startWork

        public void startWork​(javax.resource.spi.work.Work work,
                              Xid xid)
                       throws javax.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:
        javax.resource.spi.work.WorkCompletedException - thrown if there are any errors.
      • endWork

        public void endWork​(javax.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​(javax.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.