public SimpleNode parse(Reader reader, String templateName, boolean dumpNamespace)
throws ParseException
{
requireInitialization();
Parser parser = (Parser) parserPool.get();
boolean keepParser = true;
if (parser == null)
{
/*
* if we couldn't get a parser from the pool make one and log it.
*/
if (log.isInfoEnabled())
{
log.info("Runtime : ran out of parsers. Creating a new one. "
+ " Please increment the parser.pool.size property."
+ " The current value is too small.");
}
parser = createNewParser();
keepParser = false;
}
try
{
/*
* dump namespace if we are told to. Generally, you want to
* do this - you don't in special circumstances, such as
* when a VM is getting init()-ed & parsed
*/
if (dumpNamespace)
{
dumpVMNamespace(templateName);
}
return parser.parse(reader, templateName);
}
finally
{
if (keepParser)
{