/** * Call the wrapped pool. If none are available, it will create a new * temporary one. * @return A parser Object. */ public Parser get() { return (Parser) pool.get(); }
/** * Call the wrapped pool. * @param parser */ public void put(Parser parser) { parser.ReInit((CharStream) null); pool.put(parser); } }
/** * Create the underlying "pool". * @param rsvc */ public void initialize(RuntimeServices rsvc) { log = rsvc.getLog("parser"); max = rsvc.getInt(RuntimeConstants.PARSER_POOL_SIZE, RuntimeConstants.NUMBER_OF_PARSERS); pool = new SimplePool(max); for (int i = 0; i < max; i++) { pool.put(rsvc.createNewParser()); } log.debug("Created '{}' parsers.", max); }
/** * Initializes the Velocity parser pool. * This still needs to be implemented. */ private void initializeParserPool() { int numParsers = getInt( PARSER_POOL_SIZE, NUMBER_OF_PARSERS); parserPool = new SimplePool( numParsers); for (int i=0; i < numParsers ;i++ ) { parserPool.put (createNewParser()); } info ("Created: " + numParsers + " parsers."); }
/** * Create the underlying "pool". * @param rsvc */ public void initialize(RuntimeServices rsvc) { max = rsvc.getInt(RuntimeConstants.PARSER_POOL_SIZE, RuntimeConstants.NUMBER_OF_PARSERS); pool = new SimplePool(max); for (int i = 0; i < max; i++) { pool.put(rsvc.createNewParser()); } if (rsvc.getLog().isDebugEnabled()) { rsvc.getLog().debug("Created '" + max + "' parsers."); } }
/** * Call the wrapped pool. * @param parser */ public void put(Parser parser) { parser.ReInit((CharStream) null); pool.put(parser); } }
/** * Call the wrapped pool. If none are available, it will create a new * temporary one. * @return A parser Object. */ public Parser get() { return (Parser) pool.get(); }
/** * Create the underlying "pool". * @param rsvc */ public void initialize(RuntimeServices rsvc) { max = rsvc.getInt(RuntimeConstants.PARSER_POOL_SIZE, RuntimeConstants.NUMBER_OF_PARSERS); pool = new SimplePool(max); for (int i = 0; i < max; i++) { pool.put(rsvc.createNewParser()); } if (rsvc.getLog().isDebugEnabled()) { rsvc.getLog().debug("Created '" + max + "' parsers."); } }
/** * Call the wrapped pool. * @param parser */ public void put(Parser parser) { parser.ReInit((CharStream) null); pool.put(parser); } }
/** * Call the wrapped pool. If none are available, it will create a new * temporary one. * @return A parser Object. */ public Parser get() { return (Parser) pool.get(); }