Class CustomPolicy
java.lang.Object
com.yahoo.messagebus.routing.test.CustomPolicy
- All Implemented Interfaces:
RoutingPolicy
- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorDescriptionCustomPolicy
(boolean selectOnRetry, List<Integer> consumableErrors, List<Route> routes) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys this factory and frees up any resources it has held.void
merge
(RoutingContext context) This function is called when all replies have arrived for some message.void
select
(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: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 interfaceRoutingPolicy
- Parameters:
context
- the complete context for the invocation of this policy. Contains all available data.
-
merge
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 interfaceRoutingPolicy
- 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 interfaceRoutingPolicy
-