Package org.apache.jasper.compiler
Class JspRuntimeContext
- java.lang.Object
- 
- org.apache.jasper.compiler.JspRuntimeContext
 
- 
 public final class JspRuntimeContext extends java.lang.ObjectClass for tracking JSP compile time file dependencies when the >%@include file="..."%< directive is used. A background thread periodically checks the files a JSP page is dependent upon. If a dependent file changes the JSP page which included it is recompiled. Only used if a web application context is a directory.- Author:
- Glenn L. Nielsen
 
- 
- 
Constructor SummaryConstructors Constructor Description JspRuntimeContext(ServletContext context, Options options)Create a JspRuntimeContext for a web application context.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWrapper(java.lang.String jspUri, JspServletWrapper jsw)Add a new JspServletWrapper.voidcheckCompile()Method used by background thread to check the JSP dependencies registered with this class for JSP's.voidcheckUnload()Method used by background thread to check if any JSP's should be unloaded.voiddestroy()Process a "destroy" event for this web application context.java.lang.StringgetClassPath()java.security.CodeSourcegetCodeSource()Get the SecurityManager Policy CodeSource for this web application context.intgetJspCount()Returns the number of JSPs for which JspServletWrappers exist, i.e., the number of JSPs that have been loaded into the webapp.intgetJspQueueLength()Gets the number of JSPs that are in the JSP limiter queueintgetJspReloadCount()Gets the current value of the JSP reload counter.intgetJspUnloadCount()Gets the number of JSPs that have been unloaded.longgetLastJspQueueUpdate()java.lang.ClassLoadergetParentClassLoader()Get the parent ClassLoader.java.security.PermissionCollectiongetPermissionCollection()Get the SecurityManager PermissionCollection for this web application context.JspServletWrappergetWrapper(java.lang.String jspUri)Get an already existing JspServletWrapper.voidincrementJspReloadCount()Increments the JSP reload counter.booleanisCompileCheckInProgress()voidmakeYoungest(FastRemovalDequeue.Entry unloadHandle)Push unloadHandle for JspServletWrapper to front of the queue.FastRemovalDequeue.Entrypush(JspServletWrapper jsw)Push a newly compiled JspServletWrapper into the queue at first execution of jsp.voidremoveWrapper(java.lang.String jspUri)Remove a JspServletWrapper.voidsetJspReloadCount(int count)Resets the JSP reload counter.
 
- 
- 
- 
Constructor Detail- 
JspRuntimeContextpublic JspRuntimeContext(ServletContext context, Options options) Create a JspRuntimeContext for a web application context. Loads in any previously generated dependencies from file.- Parameters:
- context- ServletContext for web application
- options- The main Jasper options
 
 
- 
 - 
Method Detail- 
addWrapperpublic void addWrapper(java.lang.String jspUri, JspServletWrapper jsw)Add a new JspServletWrapper.- Parameters:
- jspUri- JSP URI
- jsw- Servlet wrapper for JSP
 
 - 
getWrapperpublic JspServletWrapper getWrapper(java.lang.String jspUri) Get an already existing JspServletWrapper.- Parameters:
- jspUri- JSP URI
- Returns:
- JspServletWrapper for JSP
 
 - 
removeWrapperpublic void removeWrapper(java.lang.String jspUri) Remove a JspServletWrapper.- Parameters:
- jspUri- JSP URI of JspServletWrapper to remove
 
 - 
pushpublic FastRemovalDequeue.Entry push(JspServletWrapper jsw) Push a newly compiled JspServletWrapper into the queue at first execution of jsp. Destroy any JSP that has been replaced in the queue.- Parameters:
- jsw- Servlet wrapper for jsp.
- Returns:
- an unloadHandle that can be pushed to front of queue at later execution times.
 
 - 
makeYoungestpublic void makeYoungest(FastRemovalDequeue.Entry unloadHandle) Push unloadHandle for JspServletWrapper to front of the queue.- Parameters:
- unloadHandle- the unloadHandle for the jsp.
 
 - 
getJspCountpublic int getJspCount() Returns the number of JSPs for which JspServletWrappers exist, i.e., the number of JSPs that have been loaded into the webapp.- Returns:
- The number of JSPs that have been loaded into the webapp
 
 - 
getCodeSourcepublic java.security.CodeSource getCodeSource() Get the SecurityManager Policy CodeSource for this web application context.- Returns:
- CodeSource for JSP
 
 - 
getParentClassLoaderpublic java.lang.ClassLoader getParentClassLoader() Get the parent ClassLoader.- Returns:
- ClassLoader parent
 
 - 
getPermissionCollectionpublic java.security.PermissionCollection getPermissionCollection() Get the SecurityManager PermissionCollection for this web application context.- Returns:
- PermissionCollection permissions
 
 - 
destroypublic void destroy() Process a "destroy" event for this web application context.
 - 
incrementJspReloadCountpublic void incrementJspReloadCount() Increments the JSP reload counter.
 - 
setJspReloadCountpublic void setJspReloadCount(int count) Resets the JSP reload counter.- Parameters:
- count- Value to which to reset the JSP reload counter
 
 - 
getJspReloadCountpublic int getJspReloadCount() Gets the current value of the JSP reload counter.- Returns:
- The current value of the JSP reload counter
 
 - 
getJspQueueLengthpublic int getJspQueueLength() Gets the number of JSPs that are in the JSP limiter queue- Returns:
- The number of JSPs (in the webapp with which this JspServlet is associated) that are in the JSP limiter queue
 
 - 
getJspUnloadCountpublic int getJspUnloadCount() Gets the number of JSPs that have been unloaded.- Returns:
- The number of JSPs (in the webapp with which this JspServlet is associated) that have been unloaded
 
 - 
checkCompilepublic void checkCompile() Method used by background thread to check the JSP dependencies registered with this class for JSP's.
 - 
isCompileCheckInProgresspublic boolean isCompileCheckInProgress() 
 - 
getClassPathpublic java.lang.String getClassPath() - Returns:
- the classpath that is passed off to the Java compiler.
 
 - 
getLastJspQueueUpdatepublic long getLastJspQueueUpdate() - Returns:
- Last time the update background task has run
 
 - 
checkUnloadpublic void checkUnload() Method used by background thread to check if any JSP's should be unloaded.
 
- 
 
-