Logo Search packages:      
Sourcecode: libjgroups-java version File versions

synchronized void org::jgroups::blocks::DistributedLockManager::abort ( Object  decree  )  throws VoteException [inline]

Abort phase for the lock acquisition or release.

Parameters:
decree should be an instance LockDecree, if not, we throw VoteException to be ignored by the VoteChannel.
Exceptions:
VoteException if we should be ignored during voting.

Implements org::jgroups::blocks::TwoPhaseVotingListener.

Definition at line 474 of file DistributedLockManager.java.

References checkPrepared(), preparedLocks, and preparedReleases.

                                                                       {
        if (!(decree instanceof LockDecree))
            throw new VoteException("Uknown decree type. Ignore me.");

        if (decree instanceof AcquireLockDecree) {


                if(log.isDebugEnabled()) log.debug("Aborting decree acquisition " + ((LockDecree)decree).lockId);

            if (!checkPrepared(preparedLocks, (LockDecree)decree))
                // there is a prepared lock owned by third party
                return;

            preparedLocks.remove(((LockDecree)decree).getKey());
        } else
        if (decree instanceof ReleaseLockDecree) {


                if(log.isDebugEnabled()) log.debug("Aborting decree release " + ((LockDecree)decree).lockId);

            if (!checkPrepared(preparedReleases, (LockDecree)decree))
                // there is a prepared release owned by third party
                return;

            preparedReleases.remove(((LockDecree)decree).getKey());
        }

    }


Generated by  Doxygen 1.6.0   Back to index