FileDocCategorySizeDatePackage
JspApplicationContextImpl.javaAPI DocGlassfish v2 API4817Fri May 04 22:32:54 BST 2007org.apache.jasper.runtime

JspApplicationContextImpl

public class JspApplicationContextImpl extends Object implements javax.servlet.jsp.JspApplicationContext
Implements javax.servlet.jsp.JspApplication

Fields Summary
private static Map
map
private ArrayList
elResolvers
private ArrayList
listeners
private ServletContext
context
private ExpressionFactory
expressionFactory
Constructors Summary
public JspApplicationContextImpl(ServletContext context)

        this.context = context;
    
Methods Summary
public voidaddELContextListener(javax.el.ELContextListener listener)

        listeners.add(listener);
    
public voidaddELResolver(javax.el.ELResolver resolver)

        if ("true".equals(context.getAttribute(Constants.FIRST_REQUEST_SEEN))) {
            throw new IllegalStateException("Attempt to invoke addELResolver "
                + "after the application has already received a request");
        }

        elResolvers.add(0, resolver);
    
protected javax.el.ELContextcreateELContext(javax.el.ELResolver resolver)


        ELContext elContext = new ELContextImpl(resolver);

        // Notify the listeners
        Iterator<ELContextListener> iter = listeners.iterator();
        while (iter.hasNext()) {
            ELContextListener elcl = iter.next();
            elcl.contextCreated(new ELContextEvent(elContext));
        }
        return elContext;
    
protected static org.apache.jasper.runtime.JspApplicationContextImplfindJspApplicationContext(javax.servlet.ServletContext context)


        JspApplicationContextImpl jaContext = map.get(context);
        if (jaContext == null) {
            jaContext = new JspApplicationContextImpl(context);
            map.put(context, jaContext);
        }
        return jaContext;
    
protected java.util.IteratorgetELResolvers()

        return elResolvers.iterator();
    
public javax.el.ExpressionFactorygetExpressionFactory()

        if (expressionFactory == null) {
            expressionFactory = ExpressionFactory.newInstance();
        }
        return expressionFactory;
    
public static voidremoveJspApplicationContext(javax.servlet.ServletContext context)

        map.remove(context);