Search in sources :

Example 1 with LockGrantorDestroyedException

use of org.apache.geode.distributed.internal.locks.LockGrantorDestroyedException in project geode by apache.

the class TXLockUpdateParticipantsMessage method updateParticipants.

/**
   * Update the Grantor with a new set of Participants. This method is meant to be used in a local
   * context (does <b>NOT</b> involve any messaging)
   */
public static void updateParticipants(DLockService svc, TXLockId txLockId, Set updatedParticipants) {
    DLockGrantor grantor = null;
    try {
        grantor = DLockGrantor.waitForGrantor(svc);
        if (grantor != null) {
            try {
                TXLockBatch txb = (TXLockBatch) grantor.getLockBatch(txLockId);
                if (txb == null) {
                    // fixes bug 42656
                    return;
                }
                txb.setParticipants(updatedParticipants);
                grantor.updateLockBatch(txLockId, txb);
            } catch (LockGrantorDestroyedException ignoreit) {
            }
        }
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
    }
}
Also used : LockGrantorDestroyedException(org.apache.geode.distributed.internal.locks.LockGrantorDestroyedException) DLockGrantor(org.apache.geode.distributed.internal.locks.DLockGrantor)

Aggregations

DLockGrantor (org.apache.geode.distributed.internal.locks.DLockGrantor)1 LockGrantorDestroyedException (org.apache.geode.distributed.internal.locks.LockGrantorDestroyedException)1