@SuppressWarnings("unchecked")
public static synchronized void init(URI uri, Class<?> callingClass) throws XMLSecurityException {
if (initialized == null || uri != null && !uri.equals(initialized)) {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(
ClassLoaderUtils.getResource("schemas/security-config.xsd", Init.class));
unmarshaller.setSchema(schema);
final UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setXIncludeAware(false);
saxParserFactory.setNamespaceAware(true);
SAXParser saxParser = saxParserFactory.newSAXParser();