oracle.cabo.servlet.xml
Class DefaultPageDescriptionCache
java.lang.Object
|
+--oracle.cabo.servlet.xml.DefaultPageDescriptionCache
- All Implemented Interfaces:
- PageDescriptionCache
- public class DefaultPageDescriptionCache
- extends java.lang.Object
- implements PageDescriptionCache
Implements a cache for UIX PageDescriptions. The cache can automatically check if the underlying file has been modified, and handles parsing errors.
=-=AEW Base class/interface? Move into cache package?
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultPageDescriptionCache
public DefaultPageDescriptionCache(ParserManager manager,
java.lang.String basePath,
boolean checkModified,
boolean displayAllErrors)
- Create a PageDescriptionCache.
-
- Parameters:
manager
- the ParserManager to use to parse files
basePath
- the root path to search for UIX files
checkModified
- if true, check on each request if the underlying UIX file has been modified
displayAllErrors
- if true, all attempts to parse that result in any warnings/errors will result in output of an error page.
DefaultPageDescriptionCache
public DefaultPageDescriptionCache(ParserManager manager,
java.lang.String basePath,
int msBetweenChecks,
boolean displayAllErrors)
- Create a PageDescriptionCache.
-
- Parameters:
manager
- the ParserManager to use to parse files
basePath
- the root path to search for UIX files
msBetweenChecks
- The number of milliseconds required to elapse before checking whether the UIX file was modified
displayAllErrors
- if true, all attempts to parse that result in any warnings/errors will result in output of an error page.
getPageDescription
public PageDescription getPageDescription(BajaContext context,
Page page)
- Gets a single PageDescription from the cache.
-
- Specified by:
getPageDescription
in interface PageDescriptionCache
-
- Parameters:
context
- the current BajaContext
page
- the page for the PageDescription
- Returns:
- a PageDescription object, or null if the file could not be loaded at all
createPageDescription
protected PageDescription createPageDescription(BajaContext context,
Page page,
NameResolver resolver,
InputStreamProvider provider)
throws java.io.IOException
- Creates the page description for the specified UIX file.
getResolver
protected NameResolver getResolver(BajaContext context,
Page page)
getUIXFileName
protected java.lang.String getUIXFileName(BajaContext context,
Page page)
createCacheDictionary
protected java.util.Dictionary createCacheDictionary()
- Creates the dictionary for the cache. Clients can subclass to substitute an LRU data structure, etc.