Package bitronix.tm.internal
Class ThreadContext
java.lang.Object
bitronix.tm.internal.ThreadContext
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet this context's resources, in the JTA 1.1 TransactionSynchronizationRegistry sense.intReturn this context's default timeout.Return the transaction linked with this thread context.voidsetTimeout(int timeout) Set this context's default timeout.voidsetTransaction(BitronixTransaction transaction) Link a transaction with this thead context.toString()Return a human-readable representation.
-
Constructor Details
-
ThreadContext
public ThreadContext()
-
-
Method Details
-
getTransaction
Return the transaction linked with this thread context.- Returns:
- the transaction linked to this thread context or null if there is none.
-
setTransaction
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
Get this context's resources, in the JTA 1.1 TransactionSynchronizationRegistry sense.- Returns:
- this context's resources.
-
toString
Return a human-readable representation.
-