org.objectweb.jotm.core.delegation
Interface DelegationManager


public interface DelegationManager

DelegationManager is the entity responsible for object delegation. A transaction is able to delegate one or more object to another transaction. Delegation of an object obj by a transaction t1 (delegator) to another transaction t2 (delegatee) implies:
- moving all locks on obj held by t1 to t2,
- disassociation of obj from t1 and its association with t2, i.e., obj will participate in the commitment of t2.
Every delegation consists of two parts: delegation (reflected by invocation one of the delegate methods) and acquirement (reflected by invocation of the acquire method). The point in time when delegation process is considered to be finished depends on the specified delegation type (reflected by values defined in DelegationType).


Method Summary
 void acquire(BasicTransaction holdTx, BasicTransaction receiveTx, int delType)
          Acquire all objects.
 void acquire(BasicTransaction holdTx, BasicTransaction receiveTx, java.lang.Object[] objArray, int delType)
          Acquire the specified array of object.
 void acquire(BasicTransaction holdTx, BasicTransaction receiveTx, java.lang.Object obj, int delType)
          Acquire the specified object.
 void delegate(BasicTransaction holdTx, BasicTransaction receiveTx, int delType)
          Delegate all object acquire by transaction.
 void delegate(BasicTransaction holdTx, BasicTransaction receiveTx, java.lang.Object[] objArray, int delType)
          Delegate the specified array of object.
 void delegate(BasicTransaction holdTx, BasicTransaction receiveTx, java.lang.Object obj, int delType)
          Delegate the specified object.
 

Method Detail

delegate

public void delegate(BasicTransaction holdTx,
                     BasicTransaction receiveTx,
                     java.lang.Object obj,
                     int delType)
Delegate the specified object. The method delegates the specified object from one transaction to another. Depending on the specified delegation type, delegation has to be confirmed by invocation of the acquire method by the delegatee.

Parameters:
holdTx - delegator
receiveTx - delegatee
obj - object to be delegated
delType - delegation type (one of the DelegationType values)

delegate

public void delegate(BasicTransaction holdTx,
                     BasicTransaction receiveTx,
                     java.lang.Object[] objArray,
                     int delType)
Delegate the specified array of object. The method delegates the specified objects from one transaction to another. Depending on the specified delegation type, delegation has to be confirmed by invocation of the acquire method by the delegatee.

Parameters:
holdTx - delegator
receiveTx - delegatee
delType - delegation type (one of the DelegationType values)

delegate

public void delegate(BasicTransaction holdTx,
                     BasicTransaction receiveTx,
                     int delType)
Delegate all object acquire by transaction. The method delegates all objects from one transaction to another. Depending on the specified delegation type, delegation has to be confirmed by invocation of the acquire method by the delegatee.

Parameters:
holdTx - delegator
receiveTx - delegatee
delType - delegation type (one of the DelegationType values)

acquire

public void acquire(BasicTransaction holdTx,
                    BasicTransaction receiveTx,
                    java.lang.Object obj,
                    int delType)
             throws InvalidAcquireException
Acquire the specified object. The method acquires the specified object that has been before delegated from one transaction to another.

Parameters:
holdTx - delegator
receiveTx - delegatee
obj - object to be delegated
delType - delegation type (one of the DelegationType values)
Throws:
InvalidAcquireException - the operation is invalid, i.e., either the corresponding delegate method has not been invoked before, or the delegation type is was not set to DelegationType.TYPE_DEFERRED

acquire

public void acquire(BasicTransaction holdTx,
                    BasicTransaction receiveTx,
                    java.lang.Object[] objArray,
                    int delType)
             throws InvalidAcquireException
Acquire the specified array of object. The method acquires the specified objects that has been before delegated from one transaction to another.

Parameters:
holdTx - delegator
receiveTx - delegatee
objArray - objects to be delegated
delType - delegation type (one of the DelegationType values)
Throws:
InvalidAcquireException - the operation is invalid, i.e., either the corresponding delegate method has not been invoked before, or the delegation type is was not set to DelegationType.TYPE_DEFERRED

acquire

public void acquire(BasicTransaction holdTx,
                    BasicTransaction receiveTx,
                    int delType)
             throws InvalidAcquireException
Acquire all objects. The method acquires all delegator transaction objects that has been before delegated.

Parameters:
holdTx - delegator
receiveTx - delegatee
delType - delegation type (one of the DelegationType values)
Throws:
InvalidAcquireException - the operation is invalid, i.e., either the corresponding delegate method has not been invoked before, or the delegation type is was not set to DelegationType.TYPE_DEFERRED