fc.util.pagetemplate
Class TemplateClassLoader
java.lang.Object
java.lang.ClassLoader
fc.util.pagetemplate.TemplateClassLoader
public class TemplateClassLoader
- extends java.lang.ClassLoader
A classloader that loads templates. Each page is loaded by it's own
separate ClassLoader.
If a page changes on disk (this is tracked by TemplateMgr
), then the
new page is loaded by a new instance of this class.
Method Summary |
java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Loads a class corresponding to a page (i.e., a name that starts
with Page.PackageName from. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplateClassLoader
public TemplateClassLoader(Log log)
- Parameters:
scratch
- absolute path to the scratch dirlog
- logging destination.
TemplateClassLoader
public TemplateClassLoader()
- Calls
TemplateClassLoader
with the logger set to:
fc.web.page.TemplateClassLoader
loadClass
public java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
- Loads a class corresponding to a page (i.e., a name that starts
with
Page.PackageName
from. Delegates the loading of all
other classes to the parent classloader (typically the system
classloader).
If the page suffix is .mp, then a name such as
foo/bar/baz.page is loaded from the scratch dir (from
/foo/bar/baz.class).
- Overrides:
loadClass
in class java.lang.ClassLoader
- Parameters:
name
- a relative page path-name (relative to the page
root directory), for example foo/bar/my.page
or ./my.page
- Throws:
java.lang.ClassNotFoundException
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception