@Override
    public void select(RoutingContext context) {
        // Require that recipients have been configured.
        if (context.getNumRecipients() == 0) {
            context.setError(DocumentProtocol.ERROR_POLICY_FAILURE,
                             "No recipients configured.");
            return;
        }

        // Invoke private select method for each candidate recipient.
        synchronized (this) {
            if (error != null) {
                context.setError(DocumentProtocol.ERROR_POLICY_FAILURE, error);
                return;
            }
            for (int i = 0; i < context.getNumRecipients(); ++i) {
                Route recipient = context.getRecipient(i);
                String routeName = recipient.toString();
                if (select(context, routeName)) {
                    Route route = context.getMessageBus().getRoutingTable(DocumentProtocol.NAME).getRoute(routeName);
                    context.addChild(route != null ? route : recipient);
                }
            }
        }
        context.setSelectOnRetry(false);

        // Notify that no children were selected, this is to differentiate this from the NO_RECIPIENTS_FOR_ROUTE error
        // that message bus will generate if there are no recipients and no reply.
        if (context.getNumChildren() == 0) {
            context.setReply(new DocumentIgnoredReply());
        }
    }
This method is called when configuration arrives from the config server. The received config object is traversed
and a local map is constructed and swapped with the current {@link #config} map.

@param cfg The configuration object given by subscription.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/DocumentRouteSelectorPolicy.java