private void scheduleSchemaForProcessing(URL schemaLocation) {
        if (cache.hasSchema(schemaLocation)) {
            return; //schema has already been compiled before, or on another thread
        }

        for (ProcessingEntry it : schemasToCompile) {
            if (it.schemaLocation.toString().equals(schemaLocation.toString())) {
                return; //schema is already scheduled for compilation
            }
        }

        try {
            JsonParser parser = jsonFactory.createJsonParser(schemaLocation);
            try {
                JsonNode rawSchema = parser.readValueAsTree();
                schemasToCompile.add(new ProcessingEntry(schemaLocation, rawSchema));
            } finally {
                parser.close();
            }
        } catch (JsonParseException jpe) {
            throw new IllegalArgumentException("The schema at location " + schemaLocation.toString() + " contains invalid JSON", jpe);
        } catch (IOException ioe) {
            throw new IllegalArgumentException("Could not retrieve schema from " + schemaLocation.toString(), ioe);
        }
    }