org.openorb.ccs.kernel
Class TransactionalLockSet

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by org.omg.CosConcurrencyControl.TransactionalLockSetPOA
          extended by org.openorb.ccs.kernel.TransactionalLockSet
All Implemented Interfaces:
org.omg.CORBA.portable.InvokeHandler, TransactionalLockSetOperations

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

Constructor Summary
TransactionalLockSet()
           
 
Method Summary
 void change_mode(org.omg.CosTransactions.Coordinator current, lock_mode held_mode, lock_mode new_mode)
          Changes the mode of a single lock for a specific transaction.
 LockCoordinator get_coordinator(org.omg.CosTransactions.Coordinator which)
          returns the lock coordinator associated with the specified transaction
 boolean isLockable(lock_mode mode)
          return whether the current lock mode permits the required lock mode
 void lock(org.omg.CosTransactions.Coordinator current, lock_mode mode)
          Acquires a lock in the specified mode for a specific transaction
 void setRelatedLockSet(TransactionalLockSet relatedLockSet)
          sets the related lock set
 void storeRolledBackedTransactions(org.omg.CosTransactions.Coordinator current)
          stores the rolledBacked transactions, since they cannot be locked again
 boolean try_lock(org.omg.CosTransactions.Coordinator current, lock_mode mode)
          Attempts to acquire a lock on the specified lock set for a specific transaction.
 void unlock(org.omg.CosTransactions.Coordinator current, lock_mode mode)
          Drops a single lock on the specified lock set in the specified mode for a specific transaction.
 void unlockAll(org.omg.CosTransactions.Coordinator current)
          drop all locks held by the specified transaction
 
Methods inherited from class org.omg.CosConcurrencyControl.TransactionalLockSetPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalLockSet

public TransactionalLockSet()
Method Detail

lock

public void lock(org.omg.CosTransactions.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

try_lock

public boolean try_lock(org.omg.CosTransactions.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(org.omg.CosTransactions.Coordinator current,
                   lock_mode mode)
            throws LockNotHeld
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:
LockNotHeld - If called on a lock that is not held.

change_mode

public void change_mode(org.omg.CosTransactions.Coordinator current,
                        lock_mode held_mode,
                        lock_mode new_mode)
                 throws LockNotHeld
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:
LockNotHeld - When no lock is held.

get_coordinator

public LockCoordinator get_coordinator(org.omg.CosTransactions.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

unlockAll

public void unlockAll(org.omg.CosTransactions.Coordinator current)
drop all locks held by the specified transaction

Parameters:
current - the reference to the coordinator of the transaction

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(TransactionalLockSet relatedLockSet)
sets the related lock set

Parameters:
relatedLockSet - the related lock set

storeRolledBackedTransactions

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

Parameters:
current - the reference to the coordinator of the transaction