Class QueryHost

java.lang.Object
org.jpos.transaction.participant.QueryHost
All Implemented Interfaces:
Configurable, TransactionConstants, TransactionParticipant

public class QueryHost extends Object implements TransactionParticipant, Configurable
Transaction participant that routes the request to a downstream MUX, waits for the response (synchronously or via continuations), and stores the response back into the Context.
  • Field Details

  • Constructor Details

    • QueryHost

      public QueryHost()
      Default constructor.
  • Method Details

    • prepare

      public int prepare(long id, Serializable ser)
      Description copied from interface: TransactionParticipant
      Called by TransactionManager in preparation for a transaction
      Specified by:
      prepare in interface TransactionParticipant
      Parameters:
      id - the Transaction identifier
      ser - transaction context
      Returns:
      PREPARED or ABORTED (| NO_JOIN | READONLY)
    • setConfiguration

      Description copied from interface: Configurable
      Configures this object with the supplied Configuration.
      Specified by:
      setConfiguration in interface Configurable
      Parameters:
      cfg - Configuration object
      Throws:
      ConfigurationException - if the configuration is invalid
    • resolveTimeout

      protected long resolveTimeout(Context ctx)
      Resolves the per-transaction request timeout, honouring any value the upstream code stashed in the context under TIMEOUT_NAME.
      Parameters:
      ctx - transaction context
      Returns:
      effective timeout in milliseconds
    • isConnected

      protected boolean isConnected(MUX mux)
      Indicates whether mux is currently connected, honouring the check-connected configuration switch.
      Parameters:
      mux - MUX selected for this transaction
      Returns:
      true if connectivity checks are disabled or the MUX reports connected