Class Join.Runner

java.lang.Object
org.jpos.transaction.participant.Join.Runner
All Implemented Interfaces:
Runnable
Enclosing class:
Join

public static class Join.Runner extends Object implements Runnable
Wraps a single nested TransactionParticipant in its own virtual thread so its lifecycle calls can run concurrently with siblings.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Mode constant: abort.
    static final int
    Mode constant: commit.
    static final String[]
    Human-readable labels indexed by mode constant.
    static final int
    Mode constant: prepare.
    static final int
    Mode constant: prepareForAbort.
    int
    Result code returned by the most recent lifecycle call.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a Runner for the given participant and transaction.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Schedules the participant's abort call on a virtual thread.
    void
    Schedules the participant's commit call on a virtual thread.
    void
    Waits for the runner's virtual thread to terminate, swallowing interrupts.
    void
    Schedules the participant's prepare call on a virtual thread.
    void
    Schedules the participant's prepareForAbort call on a virtual thread.
    void
    run()
    Invokes the appropriate lifecycle method on the wrapped participant.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Runner

      public Runner(TransactionParticipant p, long id, Serializable ctx)
      Constructs a Runner for the given participant and transaction.
      Parameters:
      p - nested participant to invoke
      id - transaction id
      ctx - transaction context
  • Method Details

    • prepare

      public void prepare()
      Schedules the participant's prepare call on a virtual thread.
    • prepareForAbort

      public void prepareForAbort()
      Schedules the participant's prepareForAbort call on a virtual thread.
    • commit

      public void commit()
      Schedules the participant's commit call on a virtual thread.
    • abort

      public void abort()
      Schedules the participant's abort call on a virtual thread.
    • run

      public void run()
      Invokes the appropriate lifecycle method on the wrapped participant.
      Specified by:
      run in interface Runnable
    • join

      public void join()
      Waits for the runner's virtual thread to terminate, swallowing interrupts.