|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ejb.plugins.lock.BeanLockSupport
Support for the BeanLock
Field Summary | |
protected Container (src) |
container
|
protected java.lang.Object |
id
The Cachekey corresponding to this Bean |
protected int |
refs
Number of threads that retrieved this lock from the manager (0 means removing) |
protected java.lang.Thread |
synched
|
protected int |
synchedDepth
|
protected Transaction (src) |
tx
Transaction holding lock on bean |
protected int |
txTimeout
|
Constructor Summary | |
BeanLockSupport()
|
Method Summary | |
void |
addRef()
Increment the reference count of this lock. |
boolean |
attemptSync()
A non-blocking method that checks if the calling thread will be able to acquire the sync lock based on the calling thread. |
abstract void |
endInvocation(Invocation (src) mi)
Callback to the BeanLock to inform it that a method invocation has ended. |
abstract void |
endTransaction(Transaction (src) tx)
Informs the lock that the given transaction has ended. |
java.lang.Object |
getId()
Get the bean instance cache id for the bean we are locking for. |
int |
getRefs()
Get the current reference count of this lock. |
java.lang.Object |
getResourceHolder()
|
Transaction (src) |
getTransaction()
Get the transaction currently associated with this lock. |
void |
releaseSync()
Release exclusive access to this lock instance. |
void |
removeRef()
Decrement the reference count of this lock. |
abstract void |
schedule(Invocation (src) mi)
This method implements the actual logic of the lock. |
void |
setContainer(Container (src) container)
set the ejb container of this lock. |
void |
setId(java.lang.Object id)
Set the bean instance cache id for the bean we are locking for. |
void |
setTimeout(int timeout)
Change long we should wait for a lock. |
void |
setTransaction(Transaction (src) tx)
The setTransaction associates a transaction with the lock. |
void |
sync()
A method that checks if the calling thread has the lock, and if it does not blocks until the lock is available. |
abstract void |
wontSynchronize(Transaction (src) tx)
Signifies to the lock that the transaction will not Synchronize (Tx demarcation not seen). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Container (src) container
protected int refs
protected java.lang.Object id
protected Transaction (src) tx
protected java.lang.Thread synched
protected int synchedDepth
protected int txTimeout
Constructor Detail |
public BeanLockSupport()
Method Detail |
public void setId(java.lang.Object id)
BeanLock (src)
setId
in interface BeanLock (src)
id
- The cache key for the bean instance we are locking for.public java.lang.Object getId()
BeanLock (src)
getId
in interface BeanLock (src)
public void setTimeout(int timeout)
BeanLock (src)
setTimeout
in interface BeanLock (src)
public void setContainer(Container (src) container)
BeanLock (src)
setContainer
in interface BeanLock (src)
public java.lang.Object getResourceHolder()
getResourceHolder
in interface Resource (src)
public boolean attemptSync()
attemptSync
in interface BeanLockExt (src)
public void sync()
sync
in interface BeanLock (src)
public void releaseSync()
BeanLock (src)
releaseSync
in interface BeanLock (src)
public abstract void schedule(Invocation (src) mi) throws java.lang.Exception
BeanLock (src)
schedule
in interface BeanLock (src)
mi
- The method invocation that needs a lock.
java.lang.Exception
public void setTransaction(Transaction (src) tx)
setTransaction
in interface BeanLock (src)
tx
- The transaction to associate with this lock.public Transaction (src) getTransaction()
BeanLock (src)
getTransaction
in interface BeanLock (src)
null
if no transaction is currently
associated with this lock.public abstract void endTransaction(Transaction (src) tx)
BeanLock (src)
endTransaction
in interface BeanLock (src)
tx
- The transaction that has ended.public abstract void wontSynchronize(Transaction (src) tx)
BeanLock (src)
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 (src)
public abstract void endInvocation(Invocation (src) mi)
BeanLock (src)
endInvocation
in interface BeanLock (src)
public void addRef()
BeanLock (src)
addRef
in interface BeanLock (src)
public void removeRef()
BeanLock (src)
removeRef
in interface BeanLock (src)
public int getRefs()
BeanLock (src)
getRefs
in interface BeanLock (src)
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |