Class CustomPolicy

java.lang.Object
com.yahoo.messagebus.routing.test.CustomPolicy
All Implemented Interfaces:
RoutingPolicy

public class CustomPolicy extends Object implements RoutingPolicy
Author:
Simon Thoresen Hult
  • Constructor Details

    • CustomPolicy

      public CustomPolicy(boolean selectOnRetry, List<Integer> consumableErrors, List<Route> routes)
  • Method Details

    • select

      public void select(RoutingContext context)
      Description copied from interface: RoutingPolicy
      This function must choose a set of services that is to receive the given message from a list of possible recipients. This is done by adding child routing contexts to the argument object. These children can then be iterated and manipulated even before selection pass is concluded.
      Specified by:
      select in interface RoutingPolicy
      Parameters:
      context - the complete context for the invocation of this policy. Contains all available data.
    • merge

      public void merge(RoutingContext context)
      Description copied from interface: RoutingPolicy
      This function is called when all replies have arrived for some message. The implementation is responsible for merging multiple replies into a single sensible reply. The replies is contained in the child context objects of the argument context, and then response must be set in that context.
      Specified by:
      merge in interface RoutingPolicy
      Parameters:
      context - the complete context for the invocation of this policy. Contains all available data.
    • destroy

      public void destroy()
      Description copied from interface: RoutingPolicy
      Destroys this factory and frees up any resources it has held. Making further calls on a destroyed factory causes a runtime exception.
      Specified by:
      destroy in interface RoutingPolicy