|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jboss.ejb.plugins.lock.BeanLockSupport
Support for the BeanLock
Revisions:
2001/07/29: marcf
| Field Summary | |
protected java.lang.Object |
id
The Cachekey corresponding to this Bean |
protected int |
numMethodLocks
Number of threads invoking methods on this bean (1 normally >1 if reentrant) |
protected boolean |
reentrant
Are reentrant calls allowed? |
protected int |
refs
Number of threads that retrieved this lock from the manager (0 means removing) |
protected boolean |
synched
|
protected javax.transaction.Transaction |
tx
Transaction holding lock on bean |
protected int |
txTimeout
|
protected static java.util.HashMap |
waiting
|
| Constructor Summary | |
BeanLockSupport()
|
|
| Method Summary | |
void |
addMethodLock()
|
void |
addRef()
|
void |
addWaiting(javax.transaction.Transaction tx)
Add a transaction waiting for a lock |
void |
deadlockDetection(javax.transaction.Transaction miTx)
|
abstract void |
endTransaction(javax.transaction.Transaction tx)
|
java.lang.Object |
getId()
|
int |
getNumMethodLocks()
|
int |
getRefs()
|
javax.transaction.Transaction |
getTransaction()
|
protected boolean |
isCallAllowed(MethodInvocation mi)
|
boolean |
isMethodLocked()
|
abstract void |
releaseMethodLock()
releaseMethodLock if we reach the count of zero it means the instance is free from threads (and reentrency) we wake up the next thread in the currentLock |
void |
releaseSync()
|
void |
removeRef()
|
void |
removeWaiting(javax.transaction.Transaction tx)
Remove a transaction waiting for a lock |
abstract void |
schedule(MethodInvocation mi)
|
void |
setId(java.lang.Object id)
|
void |
setReentrant(boolean reentrant)
|
void |
setTimeout(int timeout)
|
void |
setTransaction(javax.transaction.Transaction tx)
The setTransaction associates a transaction with the lock. |
void |
sync()
|
abstract void |
wontSynchronize(javax.transaction.Transaction tx)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int numMethodLocks
protected int refs
protected java.lang.Object id
protected boolean reentrant
protected javax.transaction.Transaction tx
protected boolean synched
protected int txTimeout
protected static java.util.HashMap waiting
| Constructor Detail |
public BeanLockSupport()
| Method Detail |
public void setId(java.lang.Object id)
setId in interface BeanLockpublic java.lang.Object getId()
getId in interface BeanLockpublic void setReentrant(boolean reentrant)
setReentrant in interface BeanLockpublic void setTimeout(int timeout)
setTimeout in interface BeanLockpublic void sync()
sync in interface BeanLockpublic void releaseSync()
releaseSync in interface BeanLock
public abstract void schedule(MethodInvocation mi)
throws java.lang.Exception
schedule in interface BeanLockpublic void setTransaction(javax.transaction.Transaction tx)
setTransaction in interface BeanLockpublic javax.transaction.Transaction getTransaction()
getTransaction in interface BeanLockpublic abstract void endTransaction(javax.transaction.Transaction tx)
endTransaction in interface BeanLockpublic abstract void wontSynchronize(javax.transaction.Transaction tx)
wontSynchronize in interface BeanLockpublic boolean isMethodLocked()
isMethodLocked in interface BeanLockpublic int getNumMethodLocks()
getNumMethodLocks in interface BeanLockpublic void addMethodLock()
addMethodLock in interface BeanLockpublic abstract void releaseMethodLock()
BeanLockreleaseMethodLock in interface BeanLockpublic void addRef()
addRef in interface BeanLockpublic void removeRef()
removeRef in interface BeanLockpublic int getRefs()
getRefs in interface BeanLockprotected boolean isCallAllowed(MethodInvocation mi)
public void deadlockDetection(javax.transaction.Transaction miTx)
throws ApplicationDeadlockException
public void addWaiting(javax.transaction.Transaction tx)
public void removeWaiting(javax.transaction.Transaction tx)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||