Class Join.Runner
java.lang.Object
org.jpos.transaction.participant.Join.Runner
- All Implemented Interfaces:
Runnable
- Enclosing class:
Join
Wraps a single nested
TransactionParticipant in its own virtual thread
so its lifecycle calls can run concurrently with siblings.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMode constant: abort.static final intMode constant: commit.static final String[]Human-readable labels indexed by mode constant.static final intMode constant: prepare.static final intMode constant: prepareForAbort.intResult code returned by the most recent lifecycle call. -
Constructor Summary
ConstructorsConstructorDescriptionRunner(TransactionParticipant p, long id, Serializable ctx) Constructs a Runner for the given participant and transaction. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Schedules the participant'sabortcall on a virtual thread.voidcommit()Schedules the participant'scommitcall on a virtual thread.voidjoin()Waits for the runner's virtual thread to terminate, swallowing interrupts.voidprepare()Schedules the participant'spreparecall on a virtual thread.voidSchedules the participant'sprepareForAbortcall on a virtual thread.voidrun()Invokes the appropriate lifecycle method on the wrapped participant.
-
Field Details
-
rc
Result code returned by the most recent lifecycle call. -
PREPARE
-
PREPARE_FOR_ABORT
-
COMMIT
-
ABORT
-
MODES
-
-
Constructor Details
-
Runner
Constructs a Runner for the given participant and transaction.- Parameters:
p- nested participant to invokeid- transaction idctx- transaction context
-
-
Method Details
-
prepare
Schedules the participant'spreparecall on a virtual thread. -
prepareForAbort
Schedules the participant'sprepareForAbortcall on a virtual thread. -
commit
Schedules the participant'scommitcall on a virtual thread. -
abort
Schedules the participant'sabortcall on a virtual thread. -
run
-
join
Waits for the runner's virtual thread to terminate, swallowing interrupts.
-