org.openorb.ccs.kernel
Class LockSet
java.lang.Object
|
+--org.omg.PortableServer.Servant
|
+--org.omg.CosConcurrencyControl.LockSetPOA
|
+--org.openorb.ccs.kernel.LockSet
- All Implemented Interfaces:
- org.omg.CORBA.portable.InvokeHandler, LockSetOperations
- public class LockSet
- extends LockSetPOA
This class provides operatiosn to acquire and release locks
- Author:
- Marina Daniel
| Methods inherited from class org.omg.PortableServer.Servant |
_default_POA, _get_delegate, _get_interface_def, _get_interface, _is_a, _non_existent, _object_id, _orb, _orb, _poa, _set_delegate, _this_object, _this_object |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LockSet
public LockSet()
lock
public void lock(lock_mode mode)
- Acquires a lock on the specified lock set in the specified mode
- Parameters:
mode - the specified mode
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)
throws LockNotHeld
- Drops a single lock on the specified lock set in the specified mode.
- Parameters:
mode - The lock mode.- Throws:
LockNotHeld - If being called to a
lock that is not held.
change_mode
public void change_mode(lock_mode held_mode,
lock_mode new_mode)
throws LockNotHeld
- Changes the mode of a single lock.
- Parameters:
held_mode - The current held mode.new_mode - The new mode.- Throws:
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
setRelatedLockSet
public void setRelatedLockSet(LockSet related_lockset)
- sets the related lock set
- Parameters:
related_lockset - the related lock set