Java Code Examples for org.apache.jasper.Options#getJspIdleTimeout()

The following examples show how to use org.apache.jasper.Options#getJspIdleTimeout() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JspServletWrapper.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
public JspServletWrapper(ServletContext servletContext,
                         Options options,
                         String tagFilePath,
                         TagInfo tagInfo,
                         JspRuntimeContext rctxt,
                         Jar tagJar) {

    this.isTagFile = true;
    this.config = null;        // not used
    this.options = options;
    this.jspUri = tagFilePath;
    this.tripCount = 0;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, tagInfo, options,
                                     servletContext, this, rctxt,
                                     tagJar);
}
 
Example 2
Source File: JspServletWrapper.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
public JspServletWrapper(ServletContext servletContext,
                         Options options,
                         String tagFilePath,
                         TagInfo tagInfo,
                         JspRuntimeContext rctxt,
                         JarResource tagJarResource) {

    this.isTagFile = true;
    this.config = null;        // not used
    this.options = options;
    this.jspUri = tagFilePath;
    this.tripCount = 0;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, tagInfo, options,
                                     servletContext, this, rctxt,
                                     tagJarResource);
}
 
Example 3
Source File: JspServletWrapper.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
public JspServletWrapper(ServletContext servletContext,
                         Options options,
                         String tagFilePath,
                         TagInfo tagInfo,
                         JspRuntimeContext rctxt,
                         JarResource tagJarResource) {

    this.isTagFile = true;
    this.config = null;        // not used
    this.options = options;
    this.jspUri = tagFilePath;
    this.tripCount = 0;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, tagInfo, options,
                                     servletContext, this, rctxt,
                                     tagJarResource);
}
 
Example 4
Source File: JspServletWrapper.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
public JspServletWrapper(ServletConfig config, Options options,
        String jspUri, JspRuntimeContext rctxt) {

    this.isTagFile = false;
    this.config = config;
    this.options = options;
    this.jspUri = jspUri;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, options,
                                     config.getServletContext(),
                                     this, rctxt);
}
 
Example 5
Source File: JspServletWrapper.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
public JspServletWrapper(ServletConfig config, Options options,
        String jspUri, JspRuntimeContext rctxt) {

    this.isTagFile = false;
    this.config = config;
    this.options = options;
    this.jspUri = jspUri;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, options,
                                     config.getServletContext(),
                                     this, rctxt);
}
 
Example 6
Source File: JspServletWrapper.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
public JspServletWrapper(ServletConfig config, Options options,
        String jspUri, JspRuntimeContext rctxt) {

    this.isTagFile = false;
    this.config = config;
    this.options = options;
    this.jspUri = jspUri;
    unloadByCount = options.getMaxLoadedJsps() > 0 ? true : false;
    unloadByIdle = options.getJspIdleTimeout() > 0 ? true : false;
    unloadAllowed = unloadByCount || unloadByIdle ? true : false;
    ctxt = new JspCompilationContext(jspUri, options,
                                     config.getServletContext(),
                                     this, rctxt);
}
 
Example 7
Source File: JspRuntimeContext.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
/**
 * Create a JspRuntimeContext for a web application context.
 *
 * Loads in any previously generated dependencies from file.
 *
 * @param context ServletContext for web application
 * @param options The main Jasper options
 */
public JspRuntimeContext(ServletContext context, Options options) {

    this.context = context;
    this.options = options;

    // Get the parent class loader
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    if (loader == null) {
        loader = this.getClass().getClassLoader();
    }

    if (log.isDebugEnabled()) {
        if (loader != null) {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           loader.toString()));
        } else {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           "<none>"));
        }
    }

    parentClassLoader =  loader;
    classpath = initClassPath();

    if (context instanceof org.apache.jasper.servlet.JspCServletContext) {
        codeSource = null;
        permissionCollection = null;
        return;
    }

    if (Constants.IS_SECURITY_ENABLED) {
        SecurityHolder holder = initSecurity();
        codeSource = holder.cs;
        permissionCollection = holder.pc;
    } else {
        codeSource = null;
        permissionCollection = null;
    }

    // If this web application context is running from a
    // directory, start the background compilation thread
    String appBase = context.getRealPath("/");
    if (!options.getDevelopment()
            && appBase != null
            && options.getCheckInterval() > 0) {
        lastCompileCheck = System.currentTimeMillis();
    }

    if (options.getMaxLoadedJsps() > 0) {
        jspQueue = new FastRemovalDequeue<>(options.getMaxLoadedJsps());
        if (log.isDebugEnabled()) {
            log.debug(Localizer.getMessage("jsp.message.jsp_queue_created",
                                           "" + options.getMaxLoadedJsps(), context.getContextPath()));
        }
    }

    /* Init parameter is in seconds, locally we use milliseconds */
    jspIdleTimeout = options.getJspIdleTimeout() * 1000;
}
 
Example 8
Source File: JspRuntimeContext.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
/**
 * Create a JspRuntimeContext for a web application context.
 *
 * Loads in any previously generated dependencies from file.
 *
 * @param context ServletContext for web application
 */
public JspRuntimeContext(ServletContext context, Options options) {

    this.context = context;
    this.options = options;

    // Get the parent class loader
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    if (loader == null) {
        loader = this.getClass().getClassLoader();
    }

    if (log.isDebugEnabled()) {
        if (loader != null) {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           loader.toString()));
        } else {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           "<none>"));
        }
    }

    parentClassLoader =  loader;
    classpath = initClassPath();

    if (context instanceof org.apache.jasper.servlet.JspCServletContext) {
        codeSource = null;
        permissionCollection = null;
        return;
    }

    if (Constants.IS_SECURITY_ENABLED) {
        SecurityHolder holder = initSecurity();
        codeSource = holder.cs;
        permissionCollection = holder.pc;
    } else {
        codeSource = null;
        permissionCollection = null;
    }

    // If this web application context is running from a
    // directory, start the background compilation thread
    String appBase = context.getRealPath("/");         
    if (!options.getDevelopment()
            && appBase != null
            && options.getCheckInterval() > 0) {
        lastCompileCheck = System.currentTimeMillis();
    }                                            

    if (options.getMaxLoadedJsps() > 0) {
        jspQueue = new FastRemovalDequeue<JspServletWrapper>(options.getMaxLoadedJsps());
        if (log.isDebugEnabled()) {
            log.debug(Localizer.getMessage("jsp.message.jsp_queue_created",
                                           "" + options.getMaxLoadedJsps(), context.getContextPath()));
        }
    }

    /* Init parameter is in seconds, locally we use milliseconds */
    jspIdleTimeout = options.getJspIdleTimeout() * 1000;
}
 
Example 9
Source File: JspRuntimeContext.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
/**
 * Create a JspRuntimeContext for a web application context.
 *
 * Loads in any previously generated dependencies from file.
 *
 * @param context ServletContext for web application
 */
public JspRuntimeContext(ServletContext context, Options options) {

    this.context = context;
    this.options = options;

    // Get the parent class loader
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    if (loader == null) {
        loader = this.getClass().getClassLoader();
    }

    if (log.isDebugEnabled()) {
        if (loader != null) {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           loader.toString()));
        } else {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           "<none>"));
        }
    }

    parentClassLoader =  loader;
    classpath = initClassPath();

    if (context instanceof org.apache.jasper.servlet.JspCServletContext) {
        codeSource = null;
        permissionCollection = null;
        return;
    }

    if (Constants.IS_SECURITY_ENABLED) {
        SecurityHolder holder = initSecurity();
        codeSource = holder.cs;
        permissionCollection = holder.pc;
    } else {
        codeSource = null;
        permissionCollection = null;
    }

    // If this web application context is running from a
    // directory, start the background compilation thread
    String appBase = context.getRealPath("/");         
    if (!options.getDevelopment()
            && appBase != null
            && options.getCheckInterval() > 0) {
        lastCompileCheck = System.currentTimeMillis();
    }                                            

    if (options.getMaxLoadedJsps() > 0) {
        jspQueue = new FastRemovalDequeue<JspServletWrapper>(options.getMaxLoadedJsps());
        if (log.isDebugEnabled()) {
            log.debug(Localizer.getMessage("jsp.message.jsp_queue_created",
                                           "" + options.getMaxLoadedJsps(), context.getContextPath()));
        }
    }

    /* Init parameter is in seconds, locally we use milliseconds */
    jspIdleTimeout = options.getJspIdleTimeout() * 1000;
}