|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.objectweb.jotm.impl.core.conflict.TransactionalLock
Transactional Lock is a transaction-aware lock implementation. It wraps
BasicLock and uses the transaction associated with the current thread
as locker.
| Constructor Summary | |
TransactionalLock(ConflictTable table)
Constructs transactional lock. |
|
| Method Summary | |
java.lang.String |
acquire(java.lang.String mode)
Acquires transactional lock. |
java.lang.String |
checkAcquire(java.lang.String mode)
Check whether lock can be acquired. |
java.lang.String[] |
getModes()
Gets transaction lock modes. |
boolean |
isAcquired()
Tests if a lock has been acquired by the current transaction. |
boolean |
isAcquired(java.lang.String mode)
Tests if a lock of the given mode has been acquired by the current transaction. |
void |
release()
Releases transactional lock. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TransactionalLock(ConflictTable table)
table - conflict table for the lock| Method Detail |
public java.lang.String[] getModes()
public java.lang.String acquire(java.lang.String mode)
throws LockConflictException,
NoTransactionException
NoTransactionException is thrown.
mode - requested lock mode
LockConflictException - if there is conflict between the current
lock mode acquired by the current transaction and the requested mode
(the supremum mode does not exist)
NoTransactionException - if no transaction is associated with the
current threadLock,
LockConversionTable
public void release()
throws NoSuchLockException,
NoTransactionException
NoTransactionException is thrown.
NoSuchLockException - if there is no lock hold by the current transaction
NoTransactionException - if no transaction is associated with the
current threadLock
public boolean isAcquired(java.lang.String mode)
throws NoTransactionException
mode - requested lock mode
NoTransactionException - if no transaction is associated with the
current threadLock
public boolean isAcquired()
throws NoTransactionException
NoTransactionException - if no transaction is associated with the
current threadLock
public java.lang.String checkAcquire(java.lang.String mode)
throws LockConflictException,
NoTransactionException
acquire(java.lang.String) method, but the lock is not acquired and the current
thread is never suspended due to the lock acquired by another locker.
mode - requested lock mode
null
if the lock has been acquired by another transaction in a
conflicting mode (i.e., null signalizes that
the current thread would be suspended if the current transaction
will acquire the lock in the given mode.
LockConflictException - if there is conflict between the current
lock mode acquired by the current transaction and the requested mode
(the supremum mode does not exist)
NoTransactionException - if no transaction is associated with the
current threadacquire(java.lang.String),
Lock,
LockConversionTable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||