Class ThreadContext

java.lang.Object
bitronix.tm.internal.ThreadContext

public class ThreadContext extends Object
Transactional context of a thread. It contains both the active transaction (if any) and all default parameters that a transaction running on a thread must inherit.
Author:
lorban
  • Constructor Details

    • ThreadContext

      public ThreadContext()
  • Method Details

    • getTransaction

      public BitronixTransaction getTransaction()
      Return the transaction linked with this thread context.
      Returns:
      the transaction linked to this thread context or null if there is none.
    • setTransaction

      public void setTransaction(BitronixTransaction transaction)
      Link a transaction with this thead context.
      Parameters:
      transaction - the transaction to link.
    • getTimeout

      public int getTimeout()
      Return this context's default timeout.
      Returns:
      this context's default timeout.
    • setTimeout

      public void setTimeout(int timeout)
      Set this context's default timeout. All transactions started by the thread linked to this context will get this value as their default timeout.
      Parameters:
      timeout - the new default timeout value in seconds.
    • getResources

      public Map<Object,Object> getResources()
      Get this context's resources, in the JTA 1.1 TransactionSynchronizationRegistry sense.
      Returns:
      this context's resources.
    • toString

      public String toString()
      Return a human-readable representation.
      Overrides:
      toString in class Object
      Returns:
      a human-readable representation.