|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.ejb.plugins.lock.BeanLockSupport org.jboss.ejb.plugins.lock.SimpleReadWriteEJBLock
public class SimpleReadWriteEJBLock
This lock allows multiple read locks concurrently. Once a writer has requested the lock, future read-lock requests whose transactions do not already have the read lock will block until all writers are done -- then all the waiting readers will concurrently go (depending on the reentrant setting / methodLock). A reader who promotes gets first crack at the write lock -- ahead of other waiting writers. If there is already a reader that is promoting, we throw an inconsistent read exception. Of course, writers have to wait for all read-locks to release before taking the write lock.
Revisions:
2002/6/4: yarrumretep
Field Summary |
---|
Fields inherited from class org.jboss.ejb.plugins.lock.BeanLockSupport |
---|
container, id, refs, synched, synchedDepth, tx, txTimeout |
Constructor Summary | |
---|---|
SimpleReadWriteEJBLock()
|
Method Summary | |
---|---|
void |
endInvocation(Invocation mi)
Callback to the BeanLock to inform it that a method invocation has ended. |
void |
endTransaction(Transaction transaction)
Informs the lock that the given transaction has ended. |
void |
schedule(Invocation mi)
This method implements the actual logic of the lock. |
void |
wontSynchronize(Transaction transaction)
Signifies to the lock that the transaction will not Synchronize (Tx demarcation not seen). |
Methods inherited from class org.jboss.ejb.plugins.lock.BeanLockSupport |
---|
addRef, attemptSync, getId, getRefs, getResourceHolder, getTransaction, releaseSync, removeRef, setContainer, setId, setTimeout, setTransaction, sync |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleReadWriteEJBLock()
Method Detail |
---|
public void schedule(Invocation mi)
BeanLock
schedule
in interface BeanLock
schedule
in class BeanLockSupport
mi
- The method invocation that needs a lock.public void endTransaction(Transaction transaction)
BeanLock
endTransaction
in interface BeanLock
endTransaction
in class BeanLockSupport
transaction
- The transaction that has ended.public void wontSynchronize(Transaction transaction)
BeanLock
OSH: This method does not seem to be called from anywhere. What is it meant for? To be called on a timeout before the transaction has terminated?
wontSynchronize
in interface BeanLock
wontSynchronize
in class BeanLockSupport
public void endInvocation(Invocation mi)
BeanLock
endInvocation
in interface BeanLock
endInvocation
in class BeanLockSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |