public class TwoPhaseVotingAdapter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TwoPhaseVotingAdapter.TwoPhaseVoteWrapper |
static class |
TwoPhaseVotingAdapter.TwoPhaseWrapper
Wrapper of the decree to voting decree.
|
Constructor and Description |
---|
TwoPhaseVotingAdapter(VotingAdapter voteChannel)
Creats an instance of the class.
|
Modifier and Type | Method and Description |
---|---|
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(Object decree,
long timeout)
Performs the two-phase voting on the decree.
|
boolean |
vote(Object decree,
long timeout,
VoteResponseProcessor voteResponseProcessor)
Performs the two-phase voting on the decree.
|
public TwoPhaseVotingAdapter(VotingAdapter voteChannel)
voteChannel
- the channel that will be used for voting.public void addListener(TwoPhaseVotingListener listener)
public void removeListener(TwoPhaseVotingListener listener)
public boolean vote(Object decree, long timeout) throws ChannelException
ChannelException
public boolean vote(Object decree, long timeout, VoteResponseProcessor voteResponseProcessor) throws ChannelException
ChannelException
public VotingAdapter getVoteChannel()
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.