|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.blocks.TwoPhaseVotingAdapter
public class TwoPhaseVotingAdapter
This adapter introduces simple two-phase voting on a specified decree. All nodes in the group receive a decree in "prepare" phase where they expres their opinion on the decree. If all nodes voted positively on decree, next phase "commit" fixes changes that were made in "prepare" phase, otherwise changes are canceled in "abort" phase.
Nested Class Summary | |
---|---|
static class |
TwoPhaseVotingAdapter.TwoPhaseVoteWrapper
|
static class |
TwoPhaseVotingAdapter.TwoPhaseWrapper
Wrapper of the decree to voting decree. |
Constructor Summary | |
---|---|
TwoPhaseVotingAdapter(VotingAdapter voteChannel)
Creats an instance of the class. |
Method Summary | |
---|---|
void |
addListener(TwoPhaseVotingListener listener)
Wraps actual listener with the VoteChannelListener and adds to the voteChannel |
VotingAdapter |
getVoteChannel()
|
void |
removeListener(TwoPhaseVotingListener listener)
Removes the listener from the voteChannel |
boolean |
vote(java.lang.Object decree,
long timeout)
Performs the two-phase voting on the decree. |
boolean |
vote(java.lang.Object decree,
long timeout,
VoteResponseProcessor voteResponseProcessor)
Performs the two-phase voting on the decree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TwoPhaseVotingAdapter(VotingAdapter voteChannel)
voteChannel
- the channel that will be used for voting.Method Detail |
---|
public void addListener(TwoPhaseVotingListener listener)
public void removeListener(TwoPhaseVotingListener listener)
public boolean vote(java.lang.Object decree, long timeout) throws ChannelException
ChannelException
public boolean vote(java.lang.Object decree, long timeout, VoteResponseProcessor voteResponseProcessor) throws ChannelException
ChannelException
public VotingAdapter getVoteChannel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |