final UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setXIncludeAware(false);
saxParserFactory.setNamespaceAware(true);
SAXParser saxParser = saxParserFactory.newSAXParser();
if (uri == null) {
URL resource = ClassLoaderUtils.getResource("security-config.xml", Init.class);
if (resource == null) {
//kind of chicken-egg problem here
I18n.init("en", "US");
throw new XMLSecurityConfigurationException("empty", "security-config.xml not found in classpath");
}
uri = resource.toURI();
}
saxParser.parse(uri.toURL().toExternalForm(), new XIncludeHandler(unmarshallerHandler));
JAXBElement<ConfigurationType> configurationTypeJAXBElement = (JAXBElement<ConfigurationType>) unmarshallerHandler.getResult();
ConfigurationProperties.init(configurationTypeJAXBElement.getValue().getProperties(), callingClass);
SecurityHeaderHandlerMapper.init(configurationTypeJAXBElement.getValue().getSecurityHeaderHandlers(), callingClass);
JCEAlgorithmMapper.init(configurationTypeJAXBElement.getValue().getJCEAlgorithmMappings());