org.openorb.ccs.kernel

Class LockSet

public class LockSet extends LockSetPOA

This class provides operatiosn to acquire and release locks

Author: Marina Daniel

Method Summary
voidchange_mode(lock_mode held_mode, lock_mode new_mode)
Changes the mode of a single lock.
booleanisLockable(lock_mode mode)
return whether the current lock mode permits the required lock mode
voidlock(lock_mode mode)
Acquires a lock on the specified lock set in the specified mode
voidsetRelatedLockSet(LockSet related_lockset)
sets the related lock set
booleantry_lock(lock_mode mode)
Attempts to acquire a lock on the specified lock set.
voidunlock(lock_mode mode)
Drops a single lock on the specified lock set in the specified mode.

Method Detail

change_mode

public void change_mode(lock_mode held_mode, lock_mode new_mode)
Changes the mode of a single lock.

Parameters: held_mode The current held mode. new_mode The new mode.

Throws: org.omg.CosConcurrencyControl.LockNotHeld Thrown when when no lock is held.

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(lock_mode mode)
Acquires a lock on the specified lock set in the specified mode

Parameters: mode the specified mode

setRelatedLockSet

public void setRelatedLockSet(LockSet related_lockset)
sets the related lock set

Parameters: related_lockset the related lock set

try_lock

public boolean try_lock(lock_mode mode)
Attempts to acquire a lock on the specified lock set.

Parameters: mode The lock mode.

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

unlock

public void unlock(lock_mode mode)
Drops a single lock on the specified lock set in the specified mode.

Parameters: mode The lock mode.

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