org.openorb.ccs.kernel

Class TransactionalLockSet

public class TransactionalLockSet extends TransactionalLockSetPOA

This class provides operations to acquire and release locks on behalf a specific transaction Each transaction lock set will be related to the coordinator of a transaction

Author: Marina Daniel

Method Summary
voidchange_mode(Coordinator current, lock_mode held_mode, lock_mode new_mode)
Changes the mode of a single lock for a specific transaction.
LockCoordinatorget_coordinator(Coordinator which)
returns the lock coordinator associated with the specified transaction
booleanisLockable(lock_mode mode)
return whether the current lock mode permits the required lock mode
voidlock(Coordinator current, lock_mode mode)
Acquires a lock in the specified mode for a specific transaction
voidsetRelatedLockSet(TransactionalLockSet relatedLockSet)
sets the related lock set
voidstoreRolledBackedTransactions(Coordinator current)
stores the rolledBacked transactions, since they cannot be locked again
booleantry_lock(Coordinator current, lock_mode mode)
Attempts to acquire a lock on the specified lock set for a specific transaction.
voidunlock(Coordinator current, lock_mode mode)
Drops a single lock on the specified lock set in the specified mode for a specific transaction.
voidunlockAll(Coordinator current)
drop all locks held by the specified transaction

Method Detail

change_mode

public void change_mode(Coordinator current, lock_mode held_mode, lock_mode new_mode)
Changes the mode of a single lock for a specific transaction.

Parameters: current The reference to the coordinator of the transaction. held_mode The current held mode. new_mode The new mode.

Throws: org.omg.CosConcurrencyControl.LockNotHeld When no lock is held.

get_coordinator

public LockCoordinator get_coordinator(Coordinator which)
returns the lock coordinator associated with the specified transaction

Parameters: which the reference to the coordinator of the transaction

Returns: the lock coordinator

isLockable

public boolean isLockable(lock_mode mode)
return whether the current lock mode permits the required lock mode

Parameters: mode the required lock mode

Returns: true if the lock set can be locked to this mode

lock

public void lock(Coordinator current, lock_mode mode)
Acquires a lock in the specified mode for a specific transaction

Parameters: current the reference to the coordinator of the transaction mode the specified mode

setRelatedLockSet

public void setRelatedLockSet(TransactionalLockSet relatedLockSet)
sets the related lock set

Parameters: relatedLockSet the related lock set

storeRolledBackedTransactions

public void storeRolledBackedTransactions(Coordinator current)
stores the rolledBacked transactions, since they cannot be locked again

Parameters: current the reference to the coordinator of the transaction

try_lock

public boolean try_lock(Coordinator current, lock_mode mode)
Attempts to acquire a lock on the specified lock set for a specific transaction.

Parameters: current The reference to the coordinator of the transaction. mode The lock mode.

Returns: True whether the lock was successful, false otherwise.

unlock

public void unlock(Coordinator current, lock_mode mode)
Drops a single lock on the specified lock set in the specified mode for a specific transaction.

Parameters: current The reference to the coordinator of the transaction. mode The lock mode.

Throws: org.omg.CosConcurrencyControl.LockNotHeld If called on a lock that is not held.

unlockAll

public void unlockAll(Coordinator current)
drop all locks held by the specified transaction

Parameters: current the reference to the coordinator of the transaction