KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > blocks > TwoPhaseVotingListener


1 package org.jgroups.blocks;
2
3 /**
4  * Implementations of this interface can participate in two-phase voting process.
5  *
6  * @author Roman Rokytskyy (rrokytskyy@acm.org)
7  */

8 public interface TwoPhaseVotingListener {
9     /**
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 JavaDoc 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 JavaDoc 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 JavaDoc decree) throws VoteException;
30
31 }
Popular Tags