bitronix.tm.internal
Class ThreadContext

java.lang.Object
  extended by 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 Summary
ThreadContext()
           
 
Method Summary
 Map<Object,Object> getResources()
          Get this context's resources, in the JTA 1.1 TransactionSynchronizationRegistry sense.
 int getTimeout()
          Return this context's default timeout.
 BitronixTransaction getTransaction()
          Return the transaction linked with this thread context.
 void setTimeout(int timeout)
          Set this context's default timeout.
 void setTransaction(BitronixTransaction transaction)
          Link a transaction with this thead context.
 String toString()
          Return a human-readable representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadContext

public ThreadContext()
Method Detail

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.


Copyright © 2006-2013 Bitronix Software. All Rights Reserved.