Interface MUXPool.StrategyHandler

  • Enclosing class:
    MUXPool

    public static interface MUXPool.StrategyHandler
    A class implementing this interface can be added to a MUXPool to override the classical built-in strategies.
    It could be added to a MUXPool like this:
        <mux class="org.jpos.q2.iso.MUXPool" logger="Q2" name="my-pool">
          <muxes>mux1 mux2 mux3</muxes>
          <strategy>round-robin</strategy>
    
          <strategy-handler class="xxx.yyy.MyPoolStrategy">
            <!-- some config here -->
          </strategy-handler>
        </mux>
     
    If the strategy-handler returns null, the MUXPool will fall back to the defined strategy (or the default one, if none defined).
    • Method Detail

      • getMUX

        MUX getMUX​(MUXPool pool,
                   ISOMsg m,
                   long maxWait)
        If this method returns null, the MUXPool will fall back to the configured built-in strategy.
        Parameters:
        pool - the MUXPool using this strategy handler
        m - the ISOMsg that we wish to send
        maxWait - deadline in milliseconds (epoch value as given by System.currentTimeMillis())
        Returns:
        an appropriate MUX for this strategy, or null if none is found