This is the Runtime system for Velocity. It is the single access point for all functionality in Velocity. It adheres to the mediator pattern and is the only structure that developers need to be familiar with in order to get Velocity to perform. The Runtime will also cooperate with external systems like Turbine. Runtime properties can set and then the Runtime is initialized. Turbine, for example, knows where the templates are to be loaded from, and where the Velocity log file should be placed. So in the case of Velocity cooperating with Turbine the code might look something like the following:
ri.setProperty(Runtime.FILE_RESOURCE_LOADER_PATH, templatePath); ri.setProperty(Runtime.RUNTIME_LOG, pathToVelocityLog); ri.init();
----------------------------------------------------------------------- N O T E S O N R U N T I M E I N I T I A L I Z A T I O N ----------------------------------------------------------------------- init() If init() is called by itself the RuntimeInstance will initialize with a set of default values. ----------------------------------------------------------------------- init(String/Properties) In this case the default velocity properties are layed down first to provide a solid base, then any properties provided in the given properties object will override the corresponding default property. -----------------------------------------------------------------------
@author
Jason van Zyl
@author
Jeff Bowden
@author
Geir Magusson Jr.
@version $Id: RuntimeInstance.java 703049 2008-10-09 03:18:58Z nbubna $