本文整理了Java中org.opensaml.Configuration.setParserPool()
方法的一些代码示例,展示了Configuration.setParserPool()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.setParserPool()
方法的具体详情如下:
包路径:org.opensaml.Configuration
类名称:Configuration
方法名:setParserPool
暂无
代码示例来源:origin: org.apache.ws.security/wss4j
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);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
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);
}
}
代码示例来源:origin: org.apache.rampart/rampart-trust
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);
}
}
代码示例来源:origin: edu.internet2.middleware/shibboleth-common
/** {@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());
}
}
}
代码示例来源:origin: org.opensaml/opensaml
/**
* 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);
}
内容来源于网络,如有侵权,请联系作者删除!