Class Join
java.lang.Object
org.jpos.transaction.participant.Join
- All Implemented Interfaces:
XmlConfigurable, AbortParticipant, TransactionConstants, TransactionParticipant
Transaction participant that runs a list of nested participants concurrently
(one virtual thread each) and merges their lifecycle results.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWraps a single nestedTransactionParticipantin its own virtual thread so its lifecycle calls can run concurrently with siblings. -
Field Summary
Fields inherited from interface TransactionConstants
ABORTED, FAIL, NO_JOIN, PAUSE, PREPARED, READONLY, RETRYModifier and TypeFieldDescriptionstatic final intTransaction has been aborted.static final intShortcut for a read-only, non-joining abort (READONLY | NO_JOIN).static final intThis participant does not join the transactionstatic final intTransaction is paused.static final intTransaction has been prepared successfully.static final intContext has not been modified (no need to persist a snapshot)static final intTransaction should be retried. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(long id, Serializable o) Runsaborton every nested participant in parallel.voidcommit(long id, Serializable o) Runscommiton every nested participant in parallel.intprepare(long id, Serializable o) Runsprepareon every nested participant in parallel and merges their results.intprepareForAbort(long id, Serializable o) RunsprepareForAborton every nested participant in parallel and merges their results.voidsetConfiguration(org.jdom2.Element e) voidCaptures theTransactionManagerused to construct nested participants.
-
Constructor Details
-
Join
public Join()Default constructor; no instance state to initialise.
-
-
Method Details
-
prepare
Runsprepareon every nested participant in parallel and merges their results.- Specified by:
preparein interfaceTransactionParticipant- Parameters:
id- transaction ido- transaction context- Returns:
- the merged action mask
-
prepareForAbort
RunsprepareForAborton every nested participant in parallel and merges their results.- Specified by:
prepareForAbortin interfaceAbortParticipant- Parameters:
id- transaction ido- transaction context- Returns:
- the merged action mask
-
commit
Runscommiton every nested participant in parallel.- Specified by:
commitin interfaceTransactionParticipant- Parameters:
id- transaction ido- transaction context
-
abort
Runsaborton every nested participant in parallel.- Specified by:
abortin interfaceTransactionParticipant- Parameters:
id- transaction ido- transaction context
-
setConfiguration
- Specified by:
setConfigurationin interfaceXmlConfigurable- Parameters:
e- XML configuration element- Throws:
ConfigurationException- if any nested participant fails to instantiate
-
setTransactionManager
Captures theTransactionManagerused to construct nested participants.- Parameters:
mgr- the hosting transaction manager
-