@Override
    public void configure(DocumentrouteselectorpolicyConfig cfg) {
        String error = null;
        Map<String, DocumentSelector> config = new HashMap<>();
        for (int i = 0; i < cfg.route().size(); i++) {
            DocumentrouteselectorpolicyConfig.Route route = cfg.route(i);
            if (route.selector().isEmpty()) {
                continue;
            }
            DocumentSelector selector;
            try {
                selector = new DocumentSelector(route.selector());
                log.log(Level.CONFIG, "Selector for route '" + route.name() + "' is '" + selector + "'");
            } catch (com.yahoo.document.select.parser.ParseException e) {
                error = "Error parsing selector '" + route.selector() + "' for route '" + route.name() + ": " +
                        e.getMessage();
                break;
            }
            config.put(route.name(), selector);
        }
        synchronized (this) {
            this.config = config;
            this.error = error;
        }
    }
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