|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.controller.scheduler.schema.TransactionExclusiveLock
A TransactionExclusiveLock
is an exclusive lock that let the
owner of the lock acquire several times the lock (but it needs to be released
only once). Acquire supports timeout and graceful withdrawal of timed out
requests.
Nested Class Summary | |
private class |
TransactionExclusiveLock.WaitingListElement
The element stored in the waiting list is the waiting thread and the transaction id of the request waiting. |
Field Summary | |
private boolean |
isLocked
|
private long |
locker
Transaction id of the lock holder. |
private java.util.ArrayList |
waitingList
ArrayList of WaitingListElement . |
Constructor Summary | |
TransactionExclusiveLock()
|
Method Summary | |
boolean |
acquire(AbstractRequest request)
Acquires an exclusive lock on this table. |
long |
getLocker()
Returns the transaction id of the lock owner. |
java.util.ArrayList |
getWaitingList()
Returns the waitingList. |
boolean |
isLocked()
Returns true if the lock is owned by someone. |
boolean |
isWaiting(long transactionId)
Returns true if the given transaction id is contained in
this lock waiting queue. |
void |
release()
Releases the lock on this table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean isLocked
private long locker
private java.util.ArrayList waitingList
ArrayList
of WaitingListElement
.
Constructor Detail |
public TransactionExclusiveLock()
Method Detail |
public boolean acquire(AbstractRequest request)
request
- request asking for the lock (timeout field is used and
updated upon waiting)
release()
public void release()
acquire(AbstractRequest)
public boolean isLocked()
true
if the lock is owned by someone.
boolean
valuepublic long getLocker()
public java.util.ArrayList getWaitingList()
ArrayList
of WaitingListElement
public boolean isWaiting(long transactionId)
true
if the given transaction id is contained in
this lock waiting queue.
transactionId
- a transaction id
boolean
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |