Search in sources :

Example 1 with FastRemovalDequeue

use of org.apache.jasper.util.FastRemovalDequeue in project tomcat by apache.

the class JspRuntimeContext method push.

/**
     * Push a newly compiled JspServletWrapper into the queue at first
     * execution of jsp. Destroy any JSP that has been replaced in the queue.
     *
     * @param jsw Servlet wrapper for jsp.
     * @return an unloadHandle that can be pushed to front of queue at later execution times.
     * */
public FastRemovalDequeue<JspServletWrapper>.Entry<JspServletWrapper> push(JspServletWrapper jsw) {
    if (log.isTraceEnabled()) {
        log.trace(Localizer.getMessage("jsp.message.jsp_added", jsw.getJspUri(), context.getContextPath()));
    }
    FastRemovalDequeue<JspServletWrapper>.Entry<JspServletWrapper> entry = jspQueue.push(jsw);
    JspServletWrapper replaced = entry.getReplaced();
    if (replaced != null) {
        if (log.isDebugEnabled()) {
            log.debug(Localizer.getMessage("jsp.message.jsp_removed_excess", replaced.getJspUri(), context.getContextPath()));
        }
        unloadJspServletWrapper(replaced);
        entry.clearReplaced();
    }
    return entry;
}
Also used : JspServletWrapper(org.apache.jasper.servlet.JspServletWrapper) FastRemovalDequeue(org.apache.jasper.util.FastRemovalDequeue)

Aggregations

JspServletWrapper (org.apache.jasper.servlet.JspServletWrapper)1 FastRemovalDequeue (org.apache.jasper.util.FastRemovalDequeue)1