|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Participant
A participant for 2PC of composite transactions.
Implementations can be added
as a 2PC participant in the icatch kernel.
VERY IMPORTANT: implementations should also override the
default equals
and hashCode
methods, in order for 2PC to work!
Field Summary | |
---|---|
static int |
READ_ONLY
Indicates that no commit/rollback needed after prepare. |
Method Summary | |
---|---|
HeuristicMessage[] |
commit(boolean onePhase)
Commit the participant's work. |
void |
forget()
Indicate that a heuristic participant can forget about its work. |
HeuristicMessage[] |
getHeuristicMessages()
Get any heuristic messages so far. |
String |
getURI()
Gets a unique URI for this participant. |
int |
prepare()
Prepare the participant. |
boolean |
recover()
Recover this instance. |
HeuristicMessage[] |
rollback()
Rollback the participant's work. |
void |
setCascadeList(Dictionary allParticipants)
For cascading 2PC, this method sets the information needed to cascade. |
void |
setGlobalSiblingCount(int count)
Set by the root coordinator: the total no of siblings detected. |
Field Detail |
---|
static final int READ_ONLY
Method Detail |
---|
boolean recover() throws SysException
SysException
- On failure.String getURI()
void setCascadeList(Dictionary allParticipants) throws SysException
allParticipants
- The information needed by
the transaction monitor for
SysException
- For unexpected failures.void setGlobalSiblingCount(int count)
count
- The global count.int prepare() throws RollbackException, HeurHazardException, HeurMixedException, SysException
RollbackException
- For a NO vote.
This indicates that the participant has already rolled back
(or marked for rollback) the work on behalf of this participant.
HeurHazardException
- On possible conflicts.
This happens for remote participants instances, in case of
communication failures.
HeurMixedException
- If some subordinate
participants voted YES, timed out and committed heuristically
whereas afterwards some NO votes where received.
SysException
- Unexpected errors.HeuristicMessage[] commit(boolean onePhase) throws HeurRollbackException, HeurHazardException, HeurMixedException, RollbackException, SysException
onePhase
- If true, one-phase commit is being started.
If the participant has received a prepare call earlier,
then it should throw a SysException here.
HeuristicRollbackException
- If the participant has rolled back.
HeuristicMixedException
- If part of it was rolled back.
HeurHazardException
- On possible conflicts.
RollbackException
- In case of one-phase commit,
and the transaction has been rolled back at the time
commit is called.
SysException
- Unexpected failure.
HeurRollbackException
HeurMixedException
HeuristicMessage[] rollback() throws HeurCommitException, HeurMixedException, HeurHazardException, SysException
HeurCommitException
- If the participant committed.
HeurHazardException
- If the participant's final state
is unsure.
HeurMixedException
- If part of it was rolled back.
SysException
- Unexpected failure.void forget()
HeuristicMessage[] getHeuristicMessages()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |