|
||||||||||
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
public abstract class BeanLockSupport
Support for the BeanLock
Field Summary | |
---|---|
protected Container |
container
|
protected 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 Thread |
synched
|
protected int |
synchedDepth
|
protected Transaction |
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 mi)
Callback to the BeanLock to inform it that a method invocation has ended. |
abstract void |
endTransaction(Transaction tx)
Informs the lock that the given transaction has ended. |
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. |
Object |
getResourceHolder()
|
Transaction |
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 mi)
This method implements the actual logic of the lock. |
void |
setContainer(Container container)
set the ejb container of this lock. |
void |
setId(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 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 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 container
protected int refs
protected Object id
protected Transaction tx
protected Thread synched
protected int synchedDepth
protected int txTimeout
Constructor Detail |
---|
public BeanLockSupport()
Method Detail |
---|
public void setId(Object id)
BeanLock
setId
in interface BeanLock
id
- The cache key for the bean instance we are locking for.public Object getId()
BeanLock
getId
in interface BeanLock
public void setTimeout(int timeout)
BeanLock
setTimeout
in interface BeanLock
public void setContainer(Container container)
BeanLock
setContainer
in interface BeanLock
public Object getResourceHolder()
getResourceHolder
in interface org.jboss.util.deadlock.Resource
public boolean attemptSync()
attemptSync
in interface BeanLockExt
public void sync()
sync
in interface BeanLock
public void releaseSync()
BeanLock
releaseSync
in interface BeanLock
public abstract void schedule(Invocation mi) throws Exception
BeanLock
schedule
in interface BeanLock
mi
- The method invocation that needs a lock.
Exception
public void setTransaction(Transaction tx)
setTransaction
in interface BeanLock
tx
- The transaction to associate with this lock.public Transaction getTransaction()
BeanLock
getTransaction
in interface BeanLock
null
if no transaction is currently
associated with this lock.public abstract void endTransaction(Transaction tx)
BeanLock
endTransaction
in interface BeanLock
tx
- The transaction that has ended.public abstract void wontSynchronize(Transaction tx)
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
public abstract void endInvocation(Invocation mi)
BeanLock
endInvocation
in interface BeanLock
public void addRef()
BeanLock
addRef
in interface BeanLock
public void removeRef()
BeanLock
removeRef
in interface BeanLock
public int getRefs()
BeanLock
getRefs
in interface BeanLock
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |