Class ErrorPolicy
java.lang.Object
com.yahoo.documentapi.messagebus.protocol.ErrorPolicy
- All Implemented Interfaces:
DocumentProtocolRoutingPolicy
,com.yahoo.messagebus.routing.RoutingPolicy
This policy assigns an error supplied at constructor time to the routing context when
select(RoutingContext)
is invoked. This is useful for returning error states to the client instead of those auto-generated by mbus when a
routing policy can not be created.- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorDescriptionErrorPolicy
(String msg) Creates a new policy that will assign anEmptyReply
with the given error to all routing contexts that invokeselect(RoutingContext)
. -
Method Summary
-
Constructor Details
-
ErrorPolicy
Creates a new policy that will assign anEmptyReply
with the given error to all routing contexts that invokeselect(RoutingContext)
.- Parameters:
msg
- The message of the error to assign.
-
-
Method Details
-
select
public void select(com.yahoo.messagebus.routing.RoutingContext ctx) - Specified by:
select
in interfacecom.yahoo.messagebus.routing.RoutingPolicy
-
merge
public void merge(com.yahoo.messagebus.routing.RoutingContext ctx) - Specified by:
merge
in interfacecom.yahoo.messagebus.routing.RoutingPolicy
-
destroy
public void destroy()- Specified by:
destroy
in interfacecom.yahoo.messagebus.routing.RoutingPolicy
-