org.jboss.tm
Class TransactionLocalDelegateImpl

java.lang.Object
  extended by org.jboss.tm.TransactionLocalDelegateImpl
All Implemented Interfaces:
TransactionLocalDelegate

public class TransactionLocalDelegateImpl
extends Object
implements TransactionLocalDelegate

An implementation of the transaction local implementation using Transaction synchronizations. There is one of these per transaction local

Version:
$Revision: 57208 $
Author:
Adrian Brock

Nested Class Summary
protected static class TransactionLocalDelegateImpl.TransactionLocalSynchronization
           
 
Field Summary
protected  TransactionManager manager
          The transaction manager
protected static EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap synchronizationsByTransaction
          The synchronizations for each transaction
 
Constructor Summary
TransactionLocalDelegateImpl(TransactionManager manager)
          Construct a new delegate for the given transaction manager
 
Method Summary
 boolean containsValue(TransactionLocal local, Transaction tx)
          does Transaction contain object?
protected static TransactionLocalDelegateImpl.TransactionLocalSynchronization getSynchronization(Transaction tx, boolean create)
          Retrieve a synchronization for the transaction
 Object getValue(TransactionLocal local, Transaction tx)
          get the transaction local value.
 void lock(TransactionLocal local, Transaction tx)
          Lock the transaction local in the context of this transaction
protected static void removeSynchronization(Transaction tx)
          Remove a synchronization
 void storeValue(TransactionLocal local, Transaction tx, Object value)
          put the value in the transaction local
 void unlock(TransactionLocal local, Transaction tx)
          Unlock the transaction local in the context of this transaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected TransactionManager manager
The transaction manager


synchronizationsByTransaction

protected static EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap synchronizationsByTransaction
The synchronizations for each transaction

Constructor Detail

TransactionLocalDelegateImpl

public TransactionLocalDelegateImpl(TransactionManager manager)
Construct a new delegate for the given transaction manager

Parameters:
manager - the transaction manager
Method Detail

getSynchronization

protected static TransactionLocalDelegateImpl.TransactionLocalSynchronization getSynchronization(Transaction tx,
                                                                                                 boolean create)
Retrieve a synchronization for the transaction

Parameters:
tx - the transaction
create - whether to create a synchronization if one doesn't exist

removeSynchronization

protected static void removeSynchronization(Transaction tx)
Remove a synchronization

Parameters:
tx - the transaction to remove

lock

public void lock(TransactionLocal local,
                 Transaction tx)
          throws InterruptedException
Description copied from interface: TransactionLocalDelegate
Lock the transaction local in the context of this transaction

Specified by:
lock in interface TransactionLocalDelegate
Throws:
InterruptedException - if the thread is interrupted

unlock

public void unlock(TransactionLocal local,
                   Transaction tx)
Description copied from interface: TransactionLocalDelegate
Unlock the transaction local in the context of this transaction

Specified by:
unlock in interface TransactionLocalDelegate

getValue

public Object getValue(TransactionLocal local,
                       Transaction tx)
Description copied from interface: TransactionLocalDelegate
get the transaction local value.

Specified by:
getValue in interface TransactionLocalDelegate

storeValue

public void storeValue(TransactionLocal local,
                       Transaction tx,
                       Object value)
Description copied from interface: TransactionLocalDelegate
put the value in the transaction local

Specified by:
storeValue in interface TransactionLocalDelegate

containsValue

public boolean containsValue(TransactionLocal local,
                             Transaction tx)
Description copied from interface: TransactionLocalDelegate
does Transaction contain object?

Specified by:
containsValue in interface TransactionLocalDelegate


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.