Class ApplicationContextFacade

  • All Implemented Interfaces:
    jakarta.servlet.ServletContext

    public final class ApplicationContextFacade
    extends Object
    implements jakarta.servlet.ServletContext
    Facade object which masks the internal ApplicationContext object from the web application.
    Version:
    $Revision: 1.7.6.1 $ $Date: 2008/04/17 18:37:06 $
    Author:
    Remy Maucherat, Jean-Francois Arcand
    • Constructor Detail

      • ApplicationContextFacade

        public ApplicationContextFacade​(ApplicationContext context)
        Construct a new instance of this class, associated with the specified Context instance.
        Parameters:
        context - The associated Context instance
    • Method Detail

      • getContextPath

        public String getContextPath()
        Specified by:
        getContextPath in interface jakarta.servlet.ServletContext
      • getContext

        public jakarta.servlet.ServletContext getContext​(String uripath)
        Specified by:
        getContext in interface jakarta.servlet.ServletContext
      • getMajorVersion

        public int getMajorVersion()
        Specified by:
        getMajorVersion in interface jakarta.servlet.ServletContext
      • getMinorVersion

        public int getMinorVersion()
        Specified by:
        getMinorVersion in interface jakarta.servlet.ServletContext
      • getEffectiveMajorVersion

        public int getEffectiveMajorVersion()
        Gets the major version of the Servlet specification that the application represented by this ServletContext is based on.
        Specified by:
        getEffectiveMajorVersion in interface jakarta.servlet.ServletContext
      • getEffectiveMinorVersion

        public int getEffectiveMinorVersion()
        Gets the minor version of the Servlet specification that the application represented by this ServletContext is based on.
        Specified by:
        getEffectiveMinorVersion in interface jakarta.servlet.ServletContext
      • getMimeType

        public String getMimeType​(String file)
        Specified by:
        getMimeType in interface jakarta.servlet.ServletContext
      • getResourcePaths

        public Set<String> getResourcePaths​(String path)
        Specified by:
        getResourcePaths in interface jakarta.servlet.ServletContext
      • getResourceAsStream

        public InputStream getResourceAsStream​(String path)
        Specified by:
        getResourceAsStream in interface jakarta.servlet.ServletContext
      • getRequestDispatcher

        public jakarta.servlet.RequestDispatcher getRequestDispatcher​(String path)
        Specified by:
        getRequestDispatcher in interface jakarta.servlet.ServletContext
      • getNamedDispatcher

        public jakarta.servlet.RequestDispatcher getNamedDispatcher​(String name)
        Specified by:
        getNamedDispatcher in interface jakarta.servlet.ServletContext
      • log

        public void log​(String msg)
        Specified by:
        log in interface jakarta.servlet.ServletContext
      • log

        public void log​(String message,
                        Throwable throwable)
        Specified by:
        log in interface jakarta.servlet.ServletContext
      • getRealPath

        public String getRealPath​(String path)
        Specified by:
        getRealPath in interface jakarta.servlet.ServletContext
      • getServerInfo

        public String getServerInfo()
        Specified by:
        getServerInfo in interface jakarta.servlet.ServletContext
      • getInitParameter

        public String getInitParameter​(String name)
        Specified by:
        getInitParameter in interface jakarta.servlet.ServletContext
      • getInitParameterNames

        public Enumeration<String> getInitParameterNames()
        Specified by:
        getInitParameterNames in interface jakarta.servlet.ServletContext
      • setInitParameter

        public boolean setInitParameter​(String name,
                                        String value)
        Specified by:
        setInitParameter in interface jakarta.servlet.ServletContext
        Returns:
        true if the context initialization parameter with the given name and value was set successfully on this ServletContext, and false if it was not set because this ServletContext already contains a context initialization parameter with a matching name
      • getAttribute

        public Object getAttribute​(String name)
        Specified by:
        getAttribute in interface jakarta.servlet.ServletContext
      • getAttributeNames

        public Enumeration<String> getAttributeNames()
        Specified by:
        getAttributeNames in interface jakarta.servlet.ServletContext
      • setAttribute

        public void setAttribute​(String name,
                                 Object object)
        Specified by:
        setAttribute in interface jakarta.servlet.ServletContext
      • removeAttribute

        public void removeAttribute​(String name)
        Specified by:
        removeAttribute in interface jakarta.servlet.ServletContext
      • getServletContextName

        public String getServletContextName()
        Specified by:
        getServletContextName in interface jakarta.servlet.ServletContext
      • addServlet

        public jakarta.servlet.ServletRegistration.Dynamic addServlet​(String servletName,
                                                                      String className)
        Specified by:
        addServlet in interface jakarta.servlet.ServletContext
      • addServlet

        public jakarta.servlet.ServletRegistration.Dynamic addServlet​(String servletName,
                                                                      jakarta.servlet.Servlet servlet)
        Specified by:
        addServlet in interface jakarta.servlet.ServletContext
      • addServlet

        public jakarta.servlet.ServletRegistration.Dynamic addServlet​(String servletName,
                                                                      Class<? extends jakarta.servlet.Servlet> servletClass)
        Specified by:
        addServlet in interface jakarta.servlet.ServletContext
      • addJspFile

        public jakarta.servlet.ServletRegistration.Dynamic addJspFile​(String servletName,
                                                                      String jspFile)
        Specified by:
        addJspFile in interface jakarta.servlet.ServletContext
      • createServlet

        public <T extends jakarta.servlet.Servlet> T createServlet​(Class<T> clazz)
                                                            throws jakarta.servlet.ServletException
        Instantiates the given Servlet class and performs any required resource injection into the new Servlet instance before returning it.
        Specified by:
        createServlet in interface jakarta.servlet.ServletContext
        Throws:
        jakarta.servlet.ServletException
      • getServletRegistration

        public jakarta.servlet.ServletRegistration getServletRegistration​(String servletName)
        Gets the ServletRegistration corresponding to the servlet with the given servletName.
        Specified by:
        getServletRegistration in interface jakarta.servlet.ServletContext
      • getServletRegistrations

        public Map<String,​? extends jakarta.servlet.ServletRegistration> getServletRegistrations()
        Gets a Map of the ServletRegistration objects corresponding to all currently registered servlets.
        Specified by:
        getServletRegistrations in interface jakarta.servlet.ServletContext
      • addFilter

        public jakarta.servlet.FilterRegistration.Dynamic addFilter​(String filterName,
                                                                    String className)
        Adds the filter with the given name and class name to this servlet context.
        Specified by:
        addFilter in interface jakarta.servlet.ServletContext
      • addFilter

        public jakarta.servlet.FilterRegistration.Dynamic addFilter​(String filterName,
                                                                    jakarta.servlet.Filter filter)
        Specified by:
        addFilter in interface jakarta.servlet.ServletContext
      • addFilter

        public jakarta.servlet.FilterRegistration.Dynamic addFilter​(String filterName,
                                                                    Class<? extends jakarta.servlet.Filter> filterClass)
        Adds the filter with the given name and class type to this servlet context.
        Specified by:
        addFilter in interface jakarta.servlet.ServletContext
      • createFilter

        public <T extends jakarta.servlet.Filter> T createFilter​(Class<T> clazz)
                                                          throws jakarta.servlet.ServletException
        Instantiates the given Filter class and performs any required resource injection into the new Filter instance before returning it.
        Specified by:
        createFilter in interface jakarta.servlet.ServletContext
        Throws:
        jakarta.servlet.ServletException
      • getFilterRegistration

        public jakarta.servlet.FilterRegistration getFilterRegistration​(String filterName)
        Gets the FilterRegistration corresponding to the filter with the given filterName.
        Specified by:
        getFilterRegistration in interface jakarta.servlet.ServletContext
      • getFilterRegistrations

        public Map<String,​? extends jakarta.servlet.FilterRegistration> getFilterRegistrations()
        Gets a Map of the FilterRegistration objects corresponding to all currently registered filters.
        Specified by:
        getFilterRegistrations in interface jakarta.servlet.ServletContext
      • getSessionCookieConfig

        public jakarta.servlet.SessionCookieConfig getSessionCookieConfig()
        Gets the SessionCookieConfig object through which various properties of the session tracking cookies created on behalf of this ServletContext may be configured.
        Specified by:
        getSessionCookieConfig in interface jakarta.servlet.ServletContext
      • setSessionTrackingModes

        public void setSessionTrackingModes​(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes)
        Sets the session tracking modes that are to become effective for this ServletContext.
        Specified by:
        setSessionTrackingModes in interface jakarta.servlet.ServletContext
      • getDefaultSessionTrackingModes

        public Set<jakarta.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
        Gets the session tracking modes that are supported by default for this ServletContext.
        Specified by:
        getDefaultSessionTrackingModes in interface jakarta.servlet.ServletContext
        Returns:
        set of the session tracking modes supported by default for this ServletContext
      • getEffectiveSessionTrackingModes

        public Set<jakarta.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()
        Gets the session tracking modes that are in effect for this ServletContext.
        Specified by:
        getEffectiveSessionTrackingModes in interface jakarta.servlet.ServletContext
        Returns:
        set of the session tracking modes in effect for this ServletContext
      • addListener

        public void addListener​(String className)
        Adds the listener with the given class name to this ServletContext.
        Specified by:
        addListener in interface jakarta.servlet.ServletContext
      • addListener

        public <T extends EventListener> void addListener​(T t)
        Adds the given listener to this ServletContext.
        Specified by:
        addListener in interface jakarta.servlet.ServletContext
      • addListener

        public void addListener​(Class<? extends EventListener> listenerClass)
        Adds a listener of the given class type to this ServletContext.
        Specified by:
        addListener in interface jakarta.servlet.ServletContext
      • createListener

        public <T extends EventListener> T createListener​(Class<T> clazz)
                                                   throws jakarta.servlet.ServletException
        Instantiates the given EventListener class and performs any required resource injection into the new EventListener instance before returning it.
        Specified by:
        createListener in interface jakarta.servlet.ServletContext
        Throws:
        jakarta.servlet.ServletException
      • getJspConfigDescriptor

        public jakarta.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
        Gets the <jsp-config> related configuration that was aggregated from the web.xml and web-fragment.xml descriptor files of the web application represented by this ServletContext.
        Specified by:
        getJspConfigDescriptor in interface jakarta.servlet.ServletContext
      • getClassLoader

        public ClassLoader getClassLoader()
        Specified by:
        getClassLoader in interface jakarta.servlet.ServletContext
      • declareRoles

        public void declareRoles​(String... roleNames)
        Specified by:
        declareRoles in interface jakarta.servlet.ServletContext
      • getVirtualServerName

        public String getVirtualServerName()
        Specified by:
        getVirtualServerName in interface jakarta.servlet.ServletContext
      • getSessionTimeout

        public int getSessionTimeout()
        Specified by:
        getSessionTimeout in interface jakarta.servlet.ServletContext
      • setSessionTimeout

        public void setSessionTimeout​(int sessionTimeout)
        Specified by:
        setSessionTimeout in interface jakarta.servlet.ServletContext
      • getRequestCharacterEncoding

        public String getRequestCharacterEncoding()
        Specified by:
        getRequestCharacterEncoding in interface jakarta.servlet.ServletContext
      • setRequestCharacterEncoding

        public void setRequestCharacterEncoding​(String encoding)
        Specified by:
        setRequestCharacterEncoding in interface jakarta.servlet.ServletContext
      • getResponseCharacterEncoding

        public String getResponseCharacterEncoding()
        Specified by:
        getResponseCharacterEncoding in interface jakarta.servlet.ServletContext
      • setResponseCharacterEncoding

        public void setResponseCharacterEncoding​(String encoding)
        Specified by:
        setResponseCharacterEncoding in interface jakarta.servlet.ServletContext