fc.web.page
Class PageMgr

java.lang.Object
  extended by fc.web.page.PageMgr

public final class PageMgr
extends Object

Manages pages. Pages are found below a web document root directory. Pages are compiled as needed and the resulting class file is loaded/run. If a page is changed, it is automatically recompiled, reloaded and rerun. If the page has a compilation error, that page remains unloaded until the error is fixed.

A new PageMgr should be instantiated for each unique root directory (for example with multiple virtual hosts or users, each having their own root directory).


Constructor Summary
PageMgr(PageServlet servlet, File docroot, File scratchdir, Log log)
          Constructs a new Page manager.
 
Method Summary
 Page getPage(String contextRelativePath)
          Returns the Page corresponding the the page path.
static void main(String[] args)
          Interactive page manager use/testing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageMgr

public PageMgr(PageServlet servlet,
               File docroot,
               File scratchdir,
               Log log)
Constructs a new Page manager. The page manager will use the system classpath and /WEB-INF/classes, /WEB-INF/lib as the classpath for complilation. Pages can refer to any class found in those locations.

Parameters:
servlet - the Molly Servlet. This is optional and can be null when creating/testing the PageMgr from the command line.
docroot - absolute path to the document root directory within which the pages are found. This is the directory that correspond to the "/" location of the webapp.
scratchdir - absolute path to a scratch dirctory where intermediate and temporary files can be written. This is where the translated page-->java file will be created.
log - a logging destination.
Method Detail

getPage

public Page getPage(String contextRelativePath)
             throws Exception
Returns the Page corresponding the the page path.

Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Interactive page manager use/testing.

Throws:
Exception