01: package org.jgroups.blocks;
02:
03: /**
04: * Implementations of this interface can participate in two-phase voting process.
05: *
06: * @author Roman Rokytskyy (rrokytskyy@acm.org)
07: */
08: public interface TwoPhaseVotingListener {
09: /**
10: * This is voting if the decree is acceptable to the party.
11: * @return <code>true</code> if the decree is acceptable.
12: * @throws VoteException if the decree type is unknown or listener
13: * does not want to vote on it.
14: */
15: boolean prepare(Object decree) throws VoteException;
16:
17: /**
18: * This is voting on the commiting the decree.
19: * @return <code>true</code> is the decree is commited.
20: * @throws VoteException if the decree type is unknown or listener
21: * does not want to vote on it.
22: */
23: boolean commit(Object decree) throws VoteException;
24:
25: /**
26: * This is unconditional abort of the previous voting on the decree.
27: * @throws VoteException if the listener ignores the abort.
28: */
29: void abort(Object decree) throws VoteException;
30:
31: }
|