public DocumentProtocolRoutingPolicy createPolicy(String param) {
            if (config != null) {
                try {
                    return new DocumentRouteSelectorPolicy(config);
                }
                catch (IllegalArgumentException e) {
                    return new ErrorPolicy(e.getMessage());
                }
            }
            DocumentRouteSelectorPolicy ret = new DocumentRouteSelectorPolicy(param == null || param.isEmpty() ?
                                                                              configId : param);
            String error = ret.getError();
            if (error != null) {
                return new ErrorPolicy(error);
            }
            return ret;
        }
@author Simon Thoresen Hult
@author jonmv
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutingPolicyFactories.java