Class GenericXaResource

  • All Implemented Interfaces:
    java.lang.Runnable, javax.transaction.xa.XAResource
    Direct Known Subclasses:
    DebugXaResource, ServiceXaWrapper

    public abstract class GenericXaResource
    extends java.lang.Thread
    implements javax.transaction.xa.XAResource
    GenericXaResource - Abstract XA Resource implementation supporting a single transaction
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
      • Fields inherited from interface javax.transaction.xa.XAResource

        TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void commit​(javax.transaction.xa.Xid xid, boolean onePhase)  
      void end​(javax.transaction.xa.Xid xid, int flag)  
      void enlist()
      Enlists this resource in the current transaction
      void enlist​(javax.transaction.Transaction tx)
      Enlists this resource in the current transaction
      void forget​(javax.transaction.xa.Xid xid)  
      javax.transaction.Transaction getTransaction()
      Gets transaction.
      int getTransactionTimeout()  
      javax.transaction.xa.Xid getXid()
      Gets xid.
      boolean isActive()
      Is active boolean.
      boolean isSameRM​(javax.transaction.xa.XAResource xaResource)  
      int prepare​(javax.transaction.xa.Xid xid)  
      javax.transaction.xa.Xid[] recover​(int flag)  
      abstract void rollback​(javax.transaction.xa.Xid xid)  
      void run()  
      void runOnTimeout()
      Method which will run when the transaction times out
      void setActive​(boolean active)
      Sets active.
      void setTransaction​(javax.transaction.Transaction t)
      Sets transaction.
      boolean setTransactionTimeout​(int seconds)  
      void setXid​(javax.transaction.xa.Xid xid)
      Sets xid.
      void start​(javax.transaction.xa.Xid xid, int flag)  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GenericXaResource

        public GenericXaResource()
    • Method Detail

      • enlist

        public void enlist()
                    throws javax.transaction.xa.XAException
        Enlists this resource in the current transaction
        Throws:
        javax.transaction.xa.XAException
      • enlist

        public void enlist​(javax.transaction.Transaction tx)
                    throws javax.transaction.xa.XAException
        Enlists this resource in the current transaction
        Throws:
        javax.transaction.xa.XAException
      • start

        public void start​(javax.transaction.xa.Xid xid,
                          int flag)
                   throws javax.transaction.xa.XAException
        Specified by:
        start in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • end

        public void end​(javax.transaction.xa.Xid xid,
                        int flag)
                 throws javax.transaction.xa.XAException
        Specified by:
        end in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • forget

        public void forget​(javax.transaction.xa.Xid xid)
                    throws javax.transaction.xa.XAException
        Specified by:
        forget in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • prepare

        public int prepare​(javax.transaction.xa.Xid xid)
                    throws javax.transaction.xa.XAException
        Specified by:
        prepare in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • recover

        public javax.transaction.xa.Xid[] recover​(int flag)
                                           throws javax.transaction.xa.XAException
        Specified by:
        recover in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • isSameRM

        public boolean isSameRM​(javax.transaction.xa.XAResource xaResource)
                         throws javax.transaction.xa.XAException
        Specified by:
        isSameRM in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • getTransactionTimeout

        public int getTransactionTimeout()
                                  throws javax.transaction.xa.XAException
        Specified by:
        getTransactionTimeout in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • setTransactionTimeout

        public boolean setTransactionTimeout​(int seconds)
                                      throws javax.transaction.xa.XAException
        Specified by:
        setTransactionTimeout in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • getTransaction

        public javax.transaction.Transaction getTransaction()
        Gets transaction.
        Returns:
        the transaction
      • setTransaction

        public void setTransaction​(javax.transaction.Transaction t)
        Sets transaction.
        Parameters:
        t - the t
      • setActive

        public void setActive​(boolean active)
        Sets active.
        Parameters:
        active - the active
      • isActive

        public boolean isActive()
        Is active boolean.
        Returns:
        the boolean
      • setXid

        public void setXid​(javax.transaction.xa.Xid xid)
        Sets xid.
        Parameters:
        xid - the xid
      • getXid

        public javax.transaction.xa.Xid getXid()
        Gets xid.
        Returns:
        the xid
      • commit

        public abstract void commit​(javax.transaction.xa.Xid xid,
                                    boolean onePhase)
                             throws javax.transaction.xa.XAException
        Specified by:
        commit in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • rollback

        public abstract void rollback​(javax.transaction.xa.Xid xid)
                               throws javax.transaction.xa.XAException
        Specified by:
        rollback in interface javax.transaction.xa.XAResource
        Throws:
        javax.transaction.xa.XAException
      • runOnTimeout

        public void runOnTimeout()
        Method which will run when the transaction times out
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread