|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atomikos.icatch.msg.MessageParticipant
public class MessageParticipant
A participant implementation that can be used on a message-based platform. This participant acts as a core proxy for remote participants that co-operate over a message-based 2PC protocol. By introducing the abstract message interface framework, the same participant instance can be reused for different message systems and different protocols.
| Field Summary |
|---|
| Fields inherited from interface com.atomikos.icatch.Participant |
|---|
READ_ONLY |
| Constructor Summary | |
|---|---|
MessageParticipant()
|
|
MessageParticipant(String remoteUri,
Object address,
Transport transport,
HeuristicMessage[] msgs,
boolean earlyPrepared,
boolean readOnly)
|
|
| Method Summary | |
|---|---|
HeuristicMessage[] |
commit(boolean onePhase)
Commits the participant's work. |
boolean |
equals(Object o)
|
void |
forget()
Indicates that a heuristic participant can forget about its work. |
Object |
getAddress()
|
int |
getCommitProtocol()
Getter for the commit protocol. |
int |
getFormat()
Getter for the format. |
HeuristicMessage[] |
getHeuristicMessages()
|
int |
getTransportProtocol()
Getter for the transport protocol. |
String |
getURI()
|
int |
hashCode()
|
int |
prepare()
Prepares the participant. |
void |
readExternal(ObjectInput in)
|
boolean |
recover()
Called by the transaction manager (TM) at recovery time, and this should reconstruct the internal state. |
HeuristicMessage[] |
rollback()
Rollback of 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. |
String |
toString()
Returns a string representation of this participant proxy. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MessageParticipant()
public MessageParticipant(String remoteUri,
Object address,
Transport transport,
HeuristicMessage[] msgs,
boolean earlyPrepared,
boolean readOnly)
| Method Detail |
|---|
public int getTransportProtocol()
public int getCommitProtocol()
public int getFormat()
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException
public boolean recover()
throws SysException
Participant
recover in interface ParticipantSysExceptionParticipantpublic Object getAddress()
public String getURI()
getURI in interface ParticipantParticipant
public void setCascadeList(Dictionary allParticipants)
throws SysException
Participant
setCascadeList in interface ParticipantallParticipants - The information needed by
the transaction monitor.
SysExceptionParticipant.public void setGlobalSiblingCount(int count)
Participant
setGlobalSiblingCount in interface Participantcount - The global count.Participant.public HeuristicMessage[] getHeuristicMessages()
getHeuristicMessages in interface ParticipantParticipantpublic int hashCode()
hashCode in class ObjectParticipant.public boolean equals(Object o)
equals in class Objectpublic String toString()
toString in class Object
public int prepare()
throws RollbackException,
HeurHazardException,
HeurMixedException,
SysException
Participant
prepare in interface ParticipantRollbackException - 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.
SysExceptionParticipant
public HeuristicMessage[] commit(boolean onePhase)
throws HeurRollbackException,
HeurHazardException,
HeurMixedException,
RollbackException,
SysException
Participant
commit in interface ParticipantonePhase - If true, one-phase commit is being started.
If the participant has received a prepare call earlier,
then it should throw a SysException here.
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
HeurRollbackException
HeurMixedExceptionParticipant
public HeuristicMessage[] rollback()
throws HeurCommitException,
HeurMixedException,
HeurHazardException,
SysException
Participant
rollback in interface ParticipantHeurCommitException - If the participant committed.
HeurMixedException - If part of the work was rolled back.
HeurHazardException - If the participant's final state
is unsure.
SysExceptionParticipantpublic void forget()
Participant
forget in interface ParticipantParticipant
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||