org.apache.jasper.compiler

Class JspRuntimeContext

public final class JspRuntimeContext extends Object

Class for tracking JSP compile time file dependencies when the &060;%@include file="..."%&062; directive is used. A background thread periodically checks the files a JSP page is dependent upon. If a dpendent file changes the JSP page which included it is recompiled. Only used if a web application context is a directory.

Version: $Revision: 788151 $

Author: Glenn L. Nielsen

Constructor Summary
JspRuntimeContext(ServletContext context, Options options)
Create a JspRuntimeContext for a web application context.
Method Summary
voidaddWrapper(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.
voiddestroy()
Process a "destory" event for this web application context.
StringgetClassPath()
The classpath that is passed off to the Java compiler.
CodeSourcegetCodeSource()
Get the SecurityManager Policy CodeSource for this web applicaiton context.
intgetJspCount()
Returns the number of JSPs for which JspServletWrappers exist, i.e., the number of JSPs that have been loaded into the webapp.
intgetJspReloadCount()
Gets the current value of the JSP reload counter.
URLClassLoadergetParentClassLoader()
Get the parent URLClassLoader.
PermissionCollectiongetPermissionCollection()
Get the SecurityManager PermissionCollection for this web application context.
JspServletWrappergetWrapper(String jspUri)
Get an already existing JspServletWrapper.
voidincrementJspReloadCount()
Increments the JSP reload counter.
voidremoveWrapper(String jspUri)
Remove a JspServletWrapper.
voidsetJspReloadCount(int count)
Resets the JSP reload counter.

Constructor Detail

JspRuntimeContext

public 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

Method Detail

addWrapper

public void addWrapper(String jspUri, JspServletWrapper jsw)
Add a new JspServletWrapper.

Parameters: jspUri JSP URI jsw Servlet wrapper for JSP

checkCompile

public void checkCompile()
Method used by background thread to check the JSP dependencies registered with this class for JSP's.

destroy

public void destroy()
Process a "destory" event for this web application context.

getClassPath

public String getClassPath()
The classpath that is passed off to the Java compiler.

getCodeSource

public CodeSource getCodeSource()
Get the SecurityManager Policy CodeSource for this web applicaiton context.

Returns: CodeSource for JSP

getJspCount

public 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

getJspReloadCount

public int getJspReloadCount()
Gets the current value of the JSP reload counter.

Returns: The current value of the JSP reload counter

getParentClassLoader

public URLClassLoader getParentClassLoader()
Get the parent URLClassLoader.

Returns: URLClassLoader parent

getPermissionCollection

public PermissionCollection getPermissionCollection()
Get the SecurityManager PermissionCollection for this web application context.

Returns: PermissionCollection permissions

getWrapper

public JspServletWrapper getWrapper(String jspUri)
Get an already existing JspServletWrapper.

Parameters: jspUri JSP URI

Returns: JspServletWrapper for JSP

incrementJspReloadCount

public void incrementJspReloadCount()
Increments the JSP reload counter.

removeWrapper

public void removeWrapper(String jspUri)
Remove a JspServletWrapper.

Parameters: jspUri JSP URI of JspServletWrapper to remove

setJspReloadCount

public void setJspReloadCount(int count)
Resets the JSP reload counter.

Parameters: count Value to which to reset the JSP reload counter

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.