Class DefaultServletEnvironment

    • Field Detail

      • UNAVAILABLE

        public static final int UNAVAILABLE
        Defines the UNAVAILABLE constant.
        See Also:
        Constant Field Values
      • asyncSupported

        protected boolean asyncSupported
        Stores the async supported flag.
      • className

        protected String className
        Stores the class name.
      • initParameters

        protected final Map<String,​String> initParameters
        Stores the init parameters.
      • loadOnStartup

        protected int loadOnStartup
        Stores the load on startup value.
      • runAsRole

        protected String runAsRole
        Stores the run-as-role.
      • servlet

        protected Servlet servlet
        Stores the servlet.
      • servletClass

        protected Class servletClass
        Stores the servlet class.
      • servletName

        protected final String servletName
        Stores the servlet name.
      • status

        protected int status
        Stores the status.
      • webApp

        protected final WebApplication webApp
        Stores the web application.
    • Constructor Detail

      • DefaultServletEnvironment

        public DefaultServletEnvironment​(DefaultWebApplication webApp,
                                         String servletName)
        Constructor.
        Parameters:
        webApp - the web application.
        servletName - the servlet name.
      • DefaultServletEnvironment

        public DefaultServletEnvironment​(DefaultWebApplication webApp,
                                         String servletName,
                                         Servlet servlet)
        Constructor.
        Parameters:
        webApp - the web application.
        servletName - the servlet name.
        servlet - the servlet.
    • Method Detail

      • addMapping

        public Set<String> addMapping​(String... urlPatterns)
        Add a mapping for the given servlet.
        Specified by:
        addMapping in interface ServletRegistration
        Parameters:
        urlPatterns - the url patterns.
        Returns:
        a set of which mappings where set.
      • getLoadOnStartup

        public int getLoadOnStartup()
        Get the load on startup.
        Returns:
        the load on startup.
      • getMultipartConfig

        public MultipartConfigElement getMultipartConfig()
        Get the multi-part config.
        Returns:
        the multi-part config.
      • getName

        public String getName()
        Get the servlet name.
        Specified by:
        getName in interface Registration
        Returns:
        the servlet name.
      • getServlet

        public Servlet getServlet()
        Get the servlet.
        Returns:
        the servlet.
      • getServletClass

        public Class getServletClass()
        Get the servlet class.
        Returns:
        the servlet class.
      • getWebApplication

        public WebApplication getWebApplication()
        Get the web application.
        Returns:
        the web application.
      • isAsyncSupported

        public boolean isAsyncSupported()
        Is async supported.
        Returns:
        true if it is, false otherwise.
      • setAsyncSupported

        public void setAsyncSupported​(boolean asyncSupported)
        Set the async supported flag.
        Specified by:
        setAsyncSupported in interface Registration.Dynamic
        Parameters:
        asyncSupported - the async supported flag.
      • setClassName

        public void setClassName​(String className)
        Set the class name.
        Parameters:
        className - the class name.
      • setInitParameter

        public boolean setInitParameter​(String name,
                                        String value)
        Set the init parameter.
        Specified by:
        setInitParameter in interface Registration
        Parameters:
        name - the parameter name.
        value - the parameter value.
        Returns:
        if the init parameter was set.
      • setInitParameters

        public Set<String> setInitParameters​(Map<String,​String> initParameters)
        Set the init parameters.
        Specified by:
        setInitParameters in interface Registration
        Parameters:
        initParameters - the init parameters.
        Returns:
        the set of set init parameters that could not be set.
      • setLoadOnStartup

        public void setLoadOnStartup​(int loadOnStartup)
        Set the load on startup.
        Specified by:
        setLoadOnStartup in interface ServletRegistration.Dynamic
        Parameters:
        loadOnStartup - the load on startup.
      • setServlet

        public void setServlet​(Servlet servlet)
        Set the servlet.
        Parameters:
        servlet - the servlet.
      • setStatus

        public void setStatus​(int status)
        Set the status.
        Parameters:
        status - the status.