| |
|
| java.lang.Object org.jboss.aspects.txlock.QueuedTxLock
QueuedTxLock | public class QueuedTxLock implements Resource(Code) | | This class is holds threads awaiting the transactional lock to be free
in a fair FIFO transactional queue. Non-transactional threads
are also put in this wait queue as well. This class pops the next waiting transaction from the queue
and notifies only those threads waiting associated with that transaction.
As of 04/10/2002, you can now specify in jboss.xml method attributes that define
methods as read-only. read-only methods(and read-only beans) will release transactional
locks at the end of the invocation. This decreases likelyhood of deadlock and increases
performance.
FIXME marcf: we should get solid numbers on this locking, bench in multi-thread environments
We need someone with serious SUN hardware to run this lock into the ground
author: Marc Fleury author: Bill Burke version: $Revision: 57186 $ |
Method Summary | |
public void | endInvocation(Transaction thetx) | public void | endTransaction() | public Object | getResourceHolder() | public Transaction | getTransaction() | protected TxLock | getTxLock(Transaction miTx) | protected boolean | isTxExpired(Transaction miTx) | public boolean | lockNoWait(Transaction transaction) | protected void | nextTransaction(boolean trace) | public void | releaseSync() | public void | schedule(Transaction miTx, org.jboss.aop.joinpoint.Invocation mi) doSchedule(Invocation)
doSchedule implements a particular policy for scheduling the threads coming in.
There is always the spec required "serialization" but we can add custom scheduling in here
Synchronizing on lock: a failure to get scheduled must result in a wait() call and a
release of the lock. | public void | setTransaction(Transaction tx) The setTransaction associates a transaction with the lock. | public void | sync() | public String | toString() | protected void | waitForTx(org.jboss.aop.joinpoint.Invocation mi, Transaction miTx, boolean trace) Wait until no other transaction is running with this lock. |
endInvocation | public void endInvocation(Transaction thetx)(Code) | | |
endTransaction | public void endTransaction()(Code) | | |
getTransaction | public Transaction getTransaction()(Code) | | |
getTxLock | protected TxLock getTxLock(Transaction miTx)(Code) | | |
isTxExpired | protected boolean isTxExpired(Transaction miTx) throws Exception(Code) | | |
lockNoWait | public boolean lockNoWait(Transaction transaction) throws Exception(Code) | | |
nextTransaction | protected void nextTransaction(boolean trace)(Code) | | |
releaseSync | public void releaseSync()(Code) | | |
schedule | public void schedule(Transaction miTx, org.jboss.aop.joinpoint.Invocation mi) throws Exception(Code) | | doSchedule(Invocation)
doSchedule implements a particular policy for scheduling the threads coming in.
There is always the spec required "serialization" but we can add custom scheduling in here
Synchronizing on lock: a failure to get scheduled must result in a wait() call and a
release of the lock. Schedulation must return with lock.
|
setTransaction | public void setTransaction(Transaction tx)(Code) | | The setTransaction associates a transaction with the lock.
The current transaction is associated by the schedule call.
|
waitForTx | protected void waitForTx(org.jboss.aop.joinpoint.Invocation mi, Transaction miTx, boolean trace) throws Exception(Code) | | Wait until no other transaction is running with this lock.
Returns true if this thread was scheduled in txWaitQueue |
|
|
|