Package cloud.piranha

Class DefaultServletEnvironment

  • java.lang.Object
    • cloud.piranha.DefaultServletEnvironment
  • All Implemented Interfaces:
    javax.servlet.Registration, javax.servlet.Registration.Dynamic, javax.servlet.ServletConfig, javax.servlet.ServletRegistration, javax.servlet.ServletRegistration.Dynamic


    public class DefaultServletEnvironment
    extends java.lang.Object
    implements javax.servlet.ServletRegistration.Dynamic, javax.servlet.ServletConfig
    The default ServletEnvironment.
    Author:
    Manfred Riem (mriem@manorrock.com)
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface javax.servlet.ServletRegistration

        javax.servlet.ServletRegistration.Dynamic
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean asyncSupported
      Stores the async supported flag.
      protected java.lang.String className
      Stores the class name.
      protected java.util.Map<java.lang.String,java.lang.String> initParameters
      Stores the init parameters.
      protected int loadOnStartup
      Stores the load on startup value.
      protected javax.servlet.MultipartConfigElement multipartConfig
      Stores the multi-part config.
      protected java.lang.String runAsRole
      Stores the run-as-role.
      protected javax.servlet.Servlet servlet
      Stores the servlet.
      protected java.lang.Class servletClass
      Stores the servlet class.
      protected java.lang.String servletName
      Stores the servlet name.
      protected int status
      Stores the status.
      static int UNAVAILABLE
      Defines the UNAVAILABLE constant.
      protected cloud.piranha.api.WebApplication webApp
      Stores the web application.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> addMapping​(java.lang.String... urlPatterns)
      Add a mapping for the given servlet.
      java.lang.String getClassName​()
      Get the class name.
      java.lang.String getInitParameter​(java.lang.String name)
      Get the init parameter.
      java.util.Enumeration<java.lang.String> getInitParameterNames​()
      Get the init parameter names.
      java.util.Map<java.lang.String,java.lang.String> getInitParameters​()
      Get the init parameters.
      int getLoadOnStartup​()
      Get the load on startup.
      java.util.Collection<java.lang.String> getMappings​()
      Get the mappings.
      javax.servlet.MultipartConfigElement getMultipartConfig​()
      Get the multi-part config.
      java.lang.String getName​()
      Get the servlet name.
      java.lang.String getRunAsRole​()
      Get the "Run as Role".
      javax.servlet.Servlet getServlet​()
      Get the servlet.
      java.lang.Class getServletClass​()
      Get the servlet class.
      javax.servlet.ServletContext getServletContext​()
      Get the servlet context.
      java.lang.String getServletName​()
      Get the servlet name.
      cloud.piranha.api.WebApplication getWebApplication​()
      Get the web application.
      boolean isAsyncSupported​()
      Is async supported.
      void setAsyncSupported​(boolean asyncSupported)
      Set the async supported flag.
      void setClassName​(java.lang.String className)
      Set the class name.
      boolean setInitParameter​(java.lang.String name, java.lang.String value)
      Set the init parameter.
      java.util.Set<java.lang.String> setInitParameters​(java.util.Map<java.lang.String,java.lang.String> initParameters)
      Set the init parameters.
      void setLoadOnStartup​(int loadOnStartup)
      Set the load on startup.
      void setMultipartConfig​(javax.servlet.MultipartConfigElement multipartConfig)
      Set the multipart config.
      void setRunAsRole​(java.lang.String runAsRole)
      Set the run as role.
      void setServlet​(javax.servlet.Servlet servlet)
      Set the servlet.
      java.util.Set<java.lang.String> setServletSecurity​(javax.servlet.ServletSecurityElement servletSecurityElement)
      Set the servlet security element.
      void setStatus​(int status)
      Set the status.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 java.lang.String className
        Stores the class name.
      • initParameters

        protected final java.util.Map<java.lang.String,java.lang.String> initParameters
        Stores the init parameters.
      • loadOnStartup

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

        protected javax.servlet.MultipartConfigElement multipartConfig
        Stores the multi-part config.
      • runAsRole

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

        protected javax.servlet.Servlet servlet
        Stores the servlet.
      • servletClass

        protected java.lang.Class servletClass
        Stores the servlet class.
      • servletName

        protected final java.lang.String servletName
        Stores the servlet name.
      • status

        protected int status
        Stores the status.
      • webApp

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

      • DefaultServletEnvironment

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

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

      • addMapping

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

        public java.lang.String getClassName​()
        Get the class name.
        Specified by:
        getClassName in interface javax.servlet.Registration
        Returns:
        the class name.
      • getInitParameter

        public java.lang.String getInitParameter​(java.lang.String name)
        Get the init parameter.
        Specified by:
        getInitParameter in interface javax.servlet.Registration
        Specified by:
        getInitParameter in interface javax.servlet.ServletConfig
        Parameters:
        name - the parameter name.
        Returns:
        the value.
      • getInitParameterNames

        public java.util.Enumeration<java.lang.String> getInitParameterNames​()
        Get the init parameter names.
        Specified by:
        getInitParameterNames in interface javax.servlet.ServletConfig
        Returns:
        the init parameter names.
      • getInitParameters

        public java.util.Map<java.lang.String,java.lang.String> getInitParameters​()
        Get the init parameters.
        Specified by:
        getInitParameters in interface javax.servlet.Registration
        Returns:
        the init parameters.
      • getLoadOnStartup

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

        public java.util.Collection<java.lang.String> getMappings​()
        Get the mappings.
        Specified by:
        getMappings in interface javax.servlet.ServletRegistration
        Returns:
        the mappings.
      • getMultipartConfig

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

        public java.lang.String getName​()
        Get the servlet name.
        Specified by:
        getName in interface javax.servlet.Registration
        Returns:
        the servlet name.
      • getRunAsRole

        public java.lang.String getRunAsRole​()
        Get the "Run as Role".
        Specified by:
        getRunAsRole in interface javax.servlet.ServletRegistration
        Returns:
        the role.
      • getServlet

        public javax.servlet.Servlet getServlet​()
        Get the servlet.
        Returns:
        the servlet.
      • getServletContext

        public javax.servlet.ServletContext getServletContext​()
        Get the servlet context.
        Specified by:
        getServletContext in interface javax.servlet.ServletConfig
        Returns:
        the servlet context.
      • getServletClass

        public java.lang.Class getServletClass​()
        Get the servlet class.
        Returns:
        the servlet class.
      • getServletName

        public java.lang.String getServletName​()
        Get the servlet name.
        Specified by:
        getServletName in interface javax.servlet.ServletConfig
        Returns:
        the servlet name.
      • getWebApplication

        public cloud.piranha.api.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 javax.servlet.Registration.Dynamic
        Parameters:
        asyncSupported - the async supported flag.
      • setClassName

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

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

        public java.util.Set<java.lang.String> setInitParameters​(java.util.Map<java.lang.String,java.lang.String> initParameters)
        Set the init parameters.
        Specified by:
        setInitParameters in interface javax.servlet.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 javax.servlet.ServletRegistration.Dynamic
        Parameters:
        loadOnStartup - the load on startup.
      • setMultipartConfig

        public void setMultipartConfig​(javax.servlet.MultipartConfigElement multipartConfig)
        Set the multipart config.
        Specified by:
        setMultipartConfig in interface javax.servlet.ServletRegistration.Dynamic
        Parameters:
        multipartConfig - the multipart config.
      • setRunAsRole

        public void setRunAsRole​(java.lang.String runAsRole)
        Set the run as role.
        Specified by:
        setRunAsRole in interface javax.servlet.ServletRegistration.Dynamic
        Parameters:
        runAsRole - the run as role.
      • setServlet

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

        public java.util.Set<java.lang.String> setServletSecurity​(javax.servlet.ServletSecurityElement servletSecurityElement)
        Set the servlet security element.
        Specified by:
        setServletSecurity in interface javax.servlet.ServletRegistration.Dynamic
        Parameters:
        servletSecurityElement - the servlet security element.
        Returns:
        the servlet security element.
      • setStatus

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

Copyright © 2020 Piranha Cloud. All rights reserved.