RoutingPolicy createPolicy(String name, String param) {
        RoutingPolicyFactory factory = getFactory(name);
        if (factory == null) {
            log.log(Level.SEVERE, "No routing policy factory found for name '" + name + "'.");
            return null;
        }
        DocumentProtocolRoutingPolicy ret = factory.createPolicy(param);

        if (ret == null) {
            log.log(Level.SEVERE, "Routing policy factory " + factory.getClass().getName() + " failed to create a " +
                    "routing policy for parameter '" + name + "'.");
            return null;
        }

        return ret;
    }
Creates and returns a routing policy using the named factory and the given parameter.

@param name  The name of the factory to use.
@param param The parameter to pass to the factory.
@return The created policy.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutingPolicyRepository.java