Class QMUX.AsyncRequest

java.lang.Object
org.jpos.q2.iso.QMUX.AsyncRequest
All Implemented Interfaces:
Runnable
Enclosing class:
QMUX

public class QMUX.AsyncRequest extends Object implements Runnable
Tracks an asynchronous request awaiting a response, with optional timeout scheduling and elapsed-time measurement.
  • Constructor Details

    • AsyncRequest

      public AsyncRequest(ISOResponseListener rl, Object handBack)
      Constructs an async request paired with the given listener and hand-back token.
      Parameters:
      rl - listener to invoke on response/expiration
      handBack - opaque token relayed back to rl
  • Method Details

    • setFuture

      public void setFuture(ScheduledFuture future)
      Sets the scheduled future used to enforce the request timeout.
      Parameters:
      future - timeout future, or null for no timeout
    • responseReceived

      public void responseReceived(ISOMsg response)
      Notifies the listener that a response has been received, cancelling the timeout future.
      Parameters:
      response - inbound response message
    • run

      public void run()
      Specified by:
      run in interface Runnable