com.caucho.quercus.page
Class PageManager

java.lang.Object
  extended by com.caucho.quercus.page.PageManager
Direct Known Subclasses:
ProGooglePageManager, ProPageManager

public class PageManager
extends java.lang.Object

Each "page" refers to a quercus file.


Field Summary
protected  LruCache<Path,java.lang.ref.SoftReference<QuercusProgram>> _programCache
           
protected static L10N L
           
 
Constructor Summary
PageManager(QuercusContext quercus)
          Constructor.
 
Method Summary
protected  void clearProgram(Path path, QuercusProgram program)
           
 void close()
           
protected  QuercusPage compilePage(QuercusProgram program, Path path)
           
 int getPageCacheSize()
          Gets the max size of the page cache.
 Path getPwd()
          Gets the owning directory.
 QuercusContext getQuercus()
           
 boolean isActive()
          true if the manager is active.
 boolean isCompile()
          true if the pages should be compiled.
 boolean isCompileFailover()
          true if interpreted pages should be used if pages fail to compile.
 boolean isLazyCompile()
          true if the pages should be compiled lazily.
 boolean isRequireSource()
          true if compiled pages require their source
 QuercusPage parse(Path path)
          Returns a parsed or compiled quercus program.
 QuercusPage parse(Path path, java.lang.String fileName, int line)
          Returns a parsed or compiled quercus program.
 QuercusPage parseImpl(Path path, java.lang.String fileName, int line)
           
 boolean precompileExists(Path path)
           
protected  QuercusProgram preloadProgram(Path path, java.lang.String fileName)
           
 void setCompile(boolean isCompile)
          true if the pages should be compiled.
 void setCompileFailover(boolean isCompileFailover)
          true if interpreted pages should be used if pages fail to compile.
 void setLazyCompile(boolean isCompile)
          true if the pages should be compiled.
 void setPageCacheSize(int size)
          Sets the max size of the page cache.
 void setRequireSource(boolean isRequireSource)
          true if compiled pages require their source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L

protected static final L10N L

_programCache

protected LruCache<Path,java.lang.ref.SoftReference<QuercusProgram>> _programCache
Constructor Detail

PageManager

public PageManager(QuercusContext quercus)
Constructor.

Method Detail

getQuercus

public QuercusContext getQuercus()

getPwd

public Path getPwd()
Gets the owning directory.


isCompile

public boolean isCompile()
true if the pages should be compiled.


setCompile

public void setCompile(boolean isCompile)
true if the pages should be compiled.


isLazyCompile

public boolean isLazyCompile()
true if the pages should be compiled lazily.


setLazyCompile

public void setLazyCompile(boolean isCompile)
true if the pages should be compiled.


isCompileFailover

public boolean isCompileFailover()
true if interpreted pages should be used if pages fail to compile.


setCompileFailover

public void setCompileFailover(boolean isCompileFailover)
true if interpreted pages should be used if pages fail to compile.


setRequireSource

public void setRequireSource(boolean isRequireSource)
true if compiled pages require their source


isRequireSource

public boolean isRequireSource()
true if compiled pages require their source


getPageCacheSize

public int getPageCacheSize()
Gets the max size of the page cache.


setPageCacheSize

public void setPageCacheSize(int size)
Sets the max size of the page cache.


isActive

public boolean isActive()
true if the manager is active.


parse

public QuercusPage parse(Path path)
                  throws java.io.IOException
Returns a parsed or compiled quercus program.

Parameters:
path - the source file path
Returns:
the parsed program
Throws:
java.io.IOException

parse

public QuercusPage parse(Path path,
                         java.lang.String fileName,
                         int line)
                  throws java.io.IOException
Returns a parsed or compiled quercus program.

Parameters:
path - the source file path
Returns:
the parsed program
Throws:
java.io.IOException

parseImpl

public QuercusPage parseImpl(Path path,
                             java.lang.String fileName,
                             int line)
                      throws java.io.IOException
Throws:
java.io.IOException

precompileExists

public boolean precompileExists(Path path)

preloadProgram

protected QuercusProgram preloadProgram(Path path,
                                        java.lang.String fileName)

clearProgram

protected void clearProgram(Path path,
                            QuercusProgram program)

compilePage

protected QuercusPage compilePage(QuercusProgram program,
                                  Path path)

close

public void close()