Interface Participant
public interface Participant
This is the interface that all two-phase aware participants must define.
- Since:
- 1.0.
- Version:
- $Id: Participant.java,v 1.3 2005/05/19 12:13:26 nmcl Exp $
- Author:
- Mark Little (mark.little@arjuna.com)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancel the participant at top-level.void
confirm()
Confirm the participant at top-level.void
Confirm the participant in a single phase.void
forget()
Inform the participant that is can forget the heuristic result.id()
prepare()
Prepare the participant for top-level.boolean
boolean
-
Method Details
-
prepare
Vote prepare() throws InvalidParticipantException, WrongStateException, HeuristicHazardException, HeuristicMixedException, SystemExceptionPrepare the participant for top-level.- Returns:
- the vote.
- Throws:
InvalidParticipantException
- Thrown if the participant identity is invalid (e.g., refers to an unknown participant.)WrongStateException
- Thrown if the state of the participant is such that it cannot prepare.HeuristicHazardException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean it cannot determine what the result of issuing prepare to them has been.HeuristicMixedException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean some of them cancelled and some of them confirmed.SystemException
- Thrown if some other error occurred.
-
confirm
void confirm() throws InvalidParticipantException, WrongStateException, HeuristicHazardException, HeuristicMixedException, HeuristicCancelException, SystemExceptionConfirm the participant at top-level.- Throws:
InvalidParticipantException
- Thrown if the participant identity is invalid (e.g., refers to an unknown participant.)WrongStateException
- Thrown if the state of the participant is such that it cannot confirm.HeuristicHazardException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean it cannot determine what the result of issuing confirm to them has been.HeuristicMixedException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean some of them cancelled and some of them confirmed.HeuristicCancelException
- Thrown if the participant rolls back rather than commits.SystemException
- Thrown if some other error occurred.
-
cancel
void cancel() throws InvalidParticipantException, WrongStateException, HeuristicHazardException, HeuristicMixedException, HeuristicConfirmException, SystemExceptionCancel the participant at top-level.- Throws:
InvalidParticipantException
- Thrown if the participant identity is invalid (e.g., refers to an unknown participant.)WrongStateException
- Thrown if the state of the participant is such that it cannot cancel.HeuristicHazardException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean it cannot determine what the result of issuing cancel to them has been.HeuristicMixedException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean some of them cancelled and some of them confirmed.HeuristicConfirmException
- Thrown if the participant commits rather than rolls back.SystemException
- Thrown if some other error occurred.
-
confirmOnePhase
void confirmOnePhase() throws InvalidParticipantException, WrongStateException, HeuristicHazardException, HeuristicMixedException, HeuristicCancelException, SystemExceptionConfirm the participant in a single phase.- Throws:
InvalidParticipantException
- Thrown if the participant identity is invalid (e.g., refers to an unknown participant.)WrongStateException
- Thrown if the state of the participant is such that it cannot cancel.HeuristicHazardException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean it cannot determine what the result of issuing cancel to them has been.HeuristicMixedException
- Thrown if upon preparing, the participant finds that some of its enlisted participants have return statuses which mean some of them cancelled and some of them confirmed.HeuristicCancelException
- Thrown if the participant rolls back rather than commit.SystemException
- Thrown if some other error occurred.
-
forget
Inform the participant that is can forget the heuristic result.- Throws:
InvalidParticipantException
- Thrown if the participant identity is invalid.WrongStateException
- Thrown if the participant is in an invalid state.SystemException
- Thrown in the event of a general fault.
-
id
- Throws:
SystemException
-
save_state
-
restore_state
-