|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.blocks.DistributedLockManager
LockService
.
@Deprecated public class DistributedLockManager
Distributed lock manager is responsible for maintaining the lock information consistent on all participating nodes.
Nested Class Summary | |
---|---|
static class |
DistributedLockManager.AcquireLockDecree
Deprecated. This class represents the lock to be released. |
static class |
DistributedLockManager.LockDecree
Deprecated. This class represents the lock |
static class |
DistributedLockManager.MultiLockDecree
Deprecated. This class represents the lock that has to be marked as multilocked |
static class |
DistributedLockManager.ReleaseLockDecree
Deprecated. This class represents the lock to be released. |
Field Summary | |
---|---|
protected Log |
log
Deprecated. |
Constructor Summary | |
---|---|
DistributedLockManager(TwoPhaseVotingAdapter channel,
java.lang.Object id)
Deprecated. Constructor for the DistributedLockManager_cl object. |
|
DistributedLockManager(VotingAdapter voteChannel,
java.lang.Object id)
Deprecated. Create instance of this class. |
Method Summary | |
---|---|
void |
abort(java.lang.Object decree)
Deprecated. Abort phase for the lock acquisition or release. |
void |
block()
Deprecated. Called (usually by the FLUSH protocol), as an indication that the member should stop sending messages. |
boolean |
commit(java.lang.Object decree)
Deprecated. Commit phase for the lock acquisition or release. |
void |
lock(java.lang.Object lockId,
java.lang.Object owner,
int timeout)
Deprecated. Locks an object with lockId on behalf of the specified
owner . |
boolean |
prepare(java.lang.Object decree)
Deprecated. Prepare phase for the lock acquisition or release. |
boolean |
processResponses(RspList responses,
int consensusType,
java.lang.Object decree)
Deprecated. Processes the response list and votes like the default processResponses method with the consensusType VOTE_ALL If the result of the voting is false, but this DistributedLockManager owns the lock, the result is changed to true and the lock is released, but marked as multiple locked. |
void |
suspect(Address suspected_mbr)
Deprecated. Called whenever a member is suspected of having crashed, but has not yet been excluded. |
void |
unlock(java.lang.Object lockId,
java.lang.Object owner)
Deprecated. Unlocks an object with lockId on behalf of the specified
owner . |
void |
unlock(java.lang.Object lockId,
java.lang.Object owner,
boolean releaseMultiLocked)
Deprecated. Unlocks an object with lockId on behalf of the specified
owner . |
void |
unlock(java.lang.Object lockId,
java.lang.Object owner,
boolean releaseMultiLocked,
long timeout)
Deprecated. |
void |
unlock(java.lang.Object lockId,
java.lang.Object owner,
long timeout)
Deprecated. |
void |
viewAccepted(View new_view)
Deprecated. Remove all locks held by members who left the previous view |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log log
Constructor Detail |
---|
public DistributedLockManager(VotingAdapter voteChannel, java.lang.Object id)
voteChannel
- instance of VotingAdapter
that will be used
for voting purposes on the lock decrees. voteChannel() will
be wrapped by the instance of the TwoPhaseVotingAdapter
.id
- the unique identifier of this lock manager.
todo check if the node with the same id is already in the group.public DistributedLockManager(TwoPhaseVotingAdapter channel, java.lang.Object id)
channel
- instance of TwoPhaseVotingAdapter
that will be used for voting purposes on the lock decrees.id
- the unique identifier of this lock manager.Method Detail |
---|
public void lock(java.lang.Object lockId, java.lang.Object owner, int timeout) throws LockNotGrantedException, ChannelException
lockId
on behalf of the specified
owner
.
lock
in interface LockManager
lockId
- Object
representing the object to be locked.owner
- object that requests the lock. This should be the Address of a JGroups member, otherwise we cannot
release the locks for a crashed member !timeout
- time during which group members should decide
whether to grant a lock or not.
LockNotGrantedException
- when the lock cannot be granted.
java.lang.ClassCastException
- if lockId or owner are not serializable.
ChannelException
- if something bad happened to underlying channel.public void unlock(java.lang.Object lockId, java.lang.Object owner) throws LockNotReleasedException, ChannelException
lockId
on behalf of the specified
owner
.
since 2.2.9 this method is only a wrapper for
unlock(Object lockId, Object owner, boolean releaseMultiLocked).
Use that with releaseMultiLocked set to true if you want to be able to
release multiple locked locks (for example after a merge)
unlock
in interface LockManager
lockId
- long
representing the object to be unlocked.owner
- object that releases the lock.
LockNotReleasedException
- when the lock cannot be released.
java.lang.ClassCastException
- if lockId or owner are not serializable.
ChannelException
- if something bad happened to communication
channel.public void unlock(java.lang.Object lockId, java.lang.Object owner, long timeout) throws LockNotReleasedException, ChannelException
LockNotReleasedException
ChannelException
public void unlock(java.lang.Object lockId, java.lang.Object owner, boolean releaseMultiLocked) throws LockNotReleasedException, ChannelException, LockMultiLockedException
lockId
on behalf of the specified
owner
.
unlock
in interface LockManager
lockId
- long
representing the object to be unlocked.owner
- object that releases the lock.releaseMultiLocked
- releases also multiple locked locks. (eg. locks that are locked by another DLM after a merge)
LockNotReleasedException
- when the lock cannot be released.
java.lang.ClassCastException
- if lockId or owner are not serializable.
LockMultiLockedException
- if releaseMultiLocked is true and a multiple locked lock has been released.
ChannelException
- if something bad happened to communication
channel.public void unlock(java.lang.Object lockId, java.lang.Object owner, boolean releaseMultiLocked, long timeout) throws LockNotReleasedException, ChannelException, LockMultiLockedException
LockNotReleasedException
ChannelException
LockMultiLockedException
public boolean prepare(java.lang.Object decree) throws VoteException
prepare
in interface TwoPhaseVotingListener
decree
- should be an instance LockDecree
, if not,
we throw VoteException
to be ignored by the
VoteChannel
.
true
when preparing the lock operation succeeds.
VoteException
- if we should be ignored during voting.public boolean commit(java.lang.Object decree) throws VoteException
commit
in interface TwoPhaseVotingListener
decree
- should be an instance LockDecree
, if not,
we throw VoteException
to be ignored by the
VoteChannel
.
true
when commiting the lock operation succeeds.
VoteException
- if we should be ignored during voting.public void abort(java.lang.Object decree) throws VoteException
abort
in interface TwoPhaseVotingListener
decree
- should be an instance LockDecree
, if not,
we throw VoteException
to be ignored by the
VoteChannel
.
VoteException
- if we should be ignored during voting.public boolean processResponses(RspList responses, int consensusType, java.lang.Object decree) throws ChannelException
Note: we do not support voting in case of Byzantine failures, i.e. when the node responds with the fault message.
processResponses
in interface VoteResponseProcessor
responses
- The responsesconsensusType
- The consensusType of the votedecree
- The vote decree
ChannelException
public void viewAccepted(View new_view)
viewAccepted
in interface MembershipListener
public void suspect(Address suspected_mbr)
MembershipListener
suspect
in interface MembershipListener
public void block()
MembershipListener
ExtendedMembershipListener.unblock()
.
Note that block() is the equivalent of reception of a BlockEvent in the pull mode.
block
in interface MembershipListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |