org.jamon
Class RecompilingTemplateManager
java.lang.Object
org.jamon.RecompilingTemplateManager
- All Implemented Interfaces:
- TemplateManager
public class RecompilingTemplateManager
- extends Object
- implements TemplateManager
An implementation of the TemplateManager interface which
supports dynamic regeneration and recompilation of templates as
they are changed, much as JSP does.
RecompilingTemplateManager instances are thread-safe. In
your applications, you generally want exactly one instance of a
RecompilingTemplateManager (i.e. a singleton).
Configuration of a RecompilingTemplateManager occurs only
at construction time, and is determined by the
RecompilingTemplateManager.Data object passed to the
constructor. The properties on the Data are:
- setSourceDir - determines where the
RecompilingTemplateManager looks for template source
files. Default is the current directory, which is most likely
unsuitable for most situations.
- setWorkDir - determines where the generated Java
source files corresponding to templates are placed. Default is
uniquely generated subdirectory under the directory specified by
the system property java.io.tmpdir.
- setJavaCompiler - determines what program to execute
to compile the generated Java source files. Default is
bin/javac under the directory specified by the system
property java.home.
- setClasspath - used to specify additional components
to prepend to the classpath when compiling generated Java source
files. Default is null.
- setClassLoader - used to set the class loader
explicitly. Default is use the class loader of the
RecompilingTemplateManager instance.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RecompilingTemplateManager
public RecompilingTemplateManager()
RecompilingTemplateManager
public RecompilingTemplateManager(RecompilingTemplateManager.Data p_data)
constructImpl
public AbstractTemplateProxy.Intf constructImpl(AbstractTemplateProxy p_proxy)
- Description copied from interface:
TemplateManager
- Given a proxy, return an instance of the executable code for
that proxy's template.
- Specified by:
constructImpl in interface TemplateManager
- Parameters:
p_proxy - a proxy for the template
- Returns:
- a
Template instance
constructProxy
public AbstractTemplateProxy constructProxy(String p_path)
- Given a template path, return a proxy for that template.
- Specified by:
constructProxy in interface TemplateManager
- Parameters:
p_path - the path to the template
- Returns:
- a
Template proxy instance