jpos / jPOS

jPOS Project
http://jpos.org
GNU Affero General Public License v3.0
609 stars 461 forks source link

MUXPool strategy handler #524

Closed barspi closed 1 year ago

barspi commented 1 year ago

A new feature to override the strategy of a MUXPool with a handler class. The handler must implement interface MUXPoolStrategyHandler

Example

<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 handler returns null, the MUXPool will fall back to its configured [built-in] <strategy>.

(the first 3 commits are mostly cleanup; the last commit has the real feature addition)