Class CustomPolicy
java.lang.Object
com.yahoo.messagebus.routing.test.CustomPolicy
- All Implemented Interfaces:
RoutingPolicy
- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorsConstructorDescriptionCustomPolicy(boolean selectOnRetry, List<Integer> consumableErrors, List<Route> routes) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroys this factory and frees up any resources it has held.voidmerge(RoutingContext context) This function is called when all replies have arrived for some message.voidselect(RoutingContext context) This function must choose a set of services that is to receive the given message from a list of possible recipients.
-
Constructor Details
-
CustomPolicy
-
-
Method Details
-
select
Description copied from interface:RoutingPolicyThis 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:
selectin interfaceRoutingPolicy- Parameters:
context- the complete context for the invocation of this policy. Contains all available data.
-
merge
Description copied from interface:RoutingPolicyThis 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:
mergein interfaceRoutingPolicy- Parameters:
context- the complete context for the invocation of this policy. Contains all available data.
-
destroy
public void destroy()Description copied from interface:RoutingPolicyDestroys this factory and frees up any resources it has held. Making further calls on a destroyed factory causes a runtime exception.- Specified by:
destroyin interfaceRoutingPolicy
-