protected static void initializeParserPool() throws ConfigurationException { StaticBasicParserPool pp = new StaticBasicParserPool(); pp.setMaxPoolSize(50); Map<String, Boolean> features = new HashMap<String, Boolean>(); features.put(XMLConstants.FEATURE_SECURE_PROCESSING, true); features.put("http://apache.org/xml/features/disallow-doctype-decl", true); pp.setBuilderFeatures(features); pp.setExpandEntityReferences(false); try { pp.initialize(); } catch (XMLParserException e) { throw new ConfigurationException("Error initializing parser pool", e); } Configuration.setParserPool(pp); } }
protected static void initializeParserPool() throws ConfigurationException { StaticBasicParserPool pp = new StaticBasicParserPool(); pp.setMaxPoolSize(50); Map<String, Boolean> features = new HashMap<String, Boolean>(); features.put(XMLConstants.FEATURE_SECURE_PROCESSING, true); features.put("http://apache.org/xml/features/disallow-doctype-decl", true); pp.setBuilderFeatures(features); pp.setExpandEntityReferences(false); try { pp.initialize(); } catch (XMLParserException e) { throw new ConfigurationException("Error initializing parser pool", e); } Configuration.setParserPool(pp); } }
protected static void initializeParserPool() throws ConfigurationException { AxiomParserPool pp = new AxiomParserPool(); pp.setMaxPoolSize(50); try { pp.initialize(); } catch (XMLParserException e) { throw new ConfigurationException("Error initializing axiom based parser pool", e); } Configuration.setParserPool(pp); } }
/** {@inheritDoc} */ public void afterPropertiesSet() throws Exception { DefaultBootstrap.bootstrap(); if(configResources != null && !configResources.isEmpty()){ XMLConfigurator configurator = new XMLConfigurator(); for(Resource config : configResources){ try{ log.debug("Loading OpenSAML configuration file: {}", config.getLocation()); configurator.load(config.getInputStream()); }catch(Exception e){ log.error("Unable to load OpenSAML configuration file: " + config.getLocation()); } } } if (getParserPool() != null) { Configuration.setParserPool(getParserPool()); } } }
/** * Initializes the default global parser pool instance. * * <p> * The ParserPool configured by default here is an instance of * {@link StaticBasicParserPool}, with a maxPoolSize property of 50 * and all other properties with default values. * </p> * * <p> * If a deployment wishes to use a different parser pool implementation, * or one configured with different characteristics, they may either override this method, * or simply configure a different ParserPool after bootstrapping via * {@link Configuration#setParserPool(org.opensaml.xml.parse.ParserPool)}. * </p> * * @throws ConfigurationException thrown if there is a problem initializing the parser pool */ protected static void initializeParserPool() throws ConfigurationException { StaticBasicParserPool pp = new StaticBasicParserPool(); pp.setMaxPoolSize(50); try { pp.initialize(); } catch (XMLParserException e) { throw new ConfigurationException("Error initializing parser pool", e); } Configuration.setParserPool(pp); }