Class DefaultServletEnvironment

java.lang.Object
cloud.piranha.core.impl.DefaultServletEnvironment
All Implemented Interfaces:
ServletEnvironment, jakarta.servlet.Registration, jakarta.servlet.Registration.Dynamic, jakarta.servlet.ServletConfig, jakarta.servlet.ServletRegistration, jakarta.servlet.ServletRegistration.Dynamic

public class DefaultServletEnvironment extends Object implements ServletEnvironment
The default ServletEnvironment.
Author:
Manfred Riem ([email protected])
  • Field Details

    • 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.
    • multipartConfig

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

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

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

      protected Class<? extends jakarta.servlet.Servlet> servletClass
      Stores the servlet class.
    • servletName

      protected final String servletName
      Stores the servlet name.
    • status

      protected int status
      Stores the status.
    • unavailableException

      protected Throwable unavailableException
      Stores the unavailableException.
    • webApp

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

    • DefaultServletEnvironment

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

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

    • addMapping

      public Set<String> addMapping(String... urlPatterns)
      Specified by:
      addMapping in interface jakarta.servlet.ServletRegistration
    • getClassName

      public String getClassName()
      Specified by:
      getClassName in interface jakarta.servlet.Registration
    • getInitParameter

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

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

      public Map<String,String> getInitParameters()
      Specified by:
      getInitParameters in interface jakarta.servlet.Registration
    • getLoadOnStartup

      public int getLoadOnStartup()
      Description copied from interface: ServletEnvironment
      Returns the load on startup.
      Specified by:
      getLoadOnStartup in interface ServletEnvironment
      Returns:
      the load on startup
    • getMappings

      public Collection<String> getMappings()
      Specified by:
      getMappings in interface jakarta.servlet.ServletRegistration
    • getMultipartConfig

      public jakarta.servlet.MultipartConfigElement getMultipartConfig()
      Description copied from interface: ServletEnvironment
      Returns the multi-part config.
      Specified by:
      getMultipartConfig in interface ServletEnvironment
      Returns:
      the multi-part config
    • getName

      public String getName()
      Specified by:
      getName in interface jakarta.servlet.Registration
    • getRunAsRole

      public String getRunAsRole()
      Specified by:
      getRunAsRole in interface jakarta.servlet.ServletRegistration
    • getServlet

      public jakarta.servlet.Servlet getServlet()
      Description copied from interface: ServletEnvironment
      Returns the servlet.
      Specified by:
      getServlet in interface ServletEnvironment
      Returns:
      the servlet
    • getServletContext

      public jakarta.servlet.ServletContext getServletContext()
      Specified by:
      getServletContext in interface jakarta.servlet.ServletConfig
    • getServletClass

      public Class<? extends jakarta.servlet.Servlet> getServletClass()
      Description copied from interface: ServletEnvironment
      Returns the servlet class.
      Specified by:
      getServletClass in interface ServletEnvironment
      Returns:
      the servlet class
    • getServletName

      public String getServletName()
      Specified by:
      getServletName in interface jakarta.servlet.ServletConfig
    • getStatus

      public int getStatus()
      Description copied from interface: ServletEnvironment
      Returns the status.
      Specified by:
      getStatus in interface ServletEnvironment
      Returns:
      the status
    • getWebApplication

      public WebApplication getWebApplication()
      Description copied from interface: ServletEnvironment
      Returns the web application.
      Specified by:
      getWebApplication in interface ServletEnvironment
      Returns:
      the web application
    • isAsyncSupported

      public boolean isAsyncSupported()
      Description copied from interface: ServletEnvironment
      Is async supported.
      Specified by:
      isAsyncSupported in interface ServletEnvironment
      Returns:
      true if it is, false otherwise.
    • setAsyncSupported

      public void setAsyncSupported(boolean asyncSupported)
      Specified by:
      setAsyncSupported in interface jakarta.servlet.Registration.Dynamic
    • setClassName

      public void setClassName(String className)
      Description copied from interface: ServletEnvironment
      Set the class name.
      Specified by:
      setClassName in interface ServletEnvironment
      Parameters:
      className - the class name.
    • setInitParameter

      public boolean setInitParameter(String name, String value)
      Specified by:
      setInitParameter in interface jakarta.servlet.Registration
    • setInitParameters

      public Set<String> setInitParameters(Map<String,String> initParameters)
      Specified by:
      setInitParameters in interface jakarta.servlet.Registration
    • setLoadOnStartup

      public void setLoadOnStartup(int loadOnStartup)
      Specified by:
      setLoadOnStartup in interface jakarta.servlet.ServletRegistration.Dynamic
    • setMultipartConfig

      public void setMultipartConfig(jakarta.servlet.MultipartConfigElement multipartConfig)
      Specified by:
      setMultipartConfig in interface jakarta.servlet.ServletRegistration.Dynamic
    • setRunAsRole

      public void setRunAsRole(String runAsRole)
      Specified by:
      setRunAsRole in interface jakarta.servlet.ServletRegistration.Dynamic
    • setServlet

      public void setServlet(jakarta.servlet.Servlet servlet)
      Description copied from interface: ServletEnvironment
      Set the servlet.
      Specified by:
      setServlet in interface ServletEnvironment
      Parameters:
      servlet - the servlet.
    • setServletSecurity

      public Set<String> setServletSecurity(jakarta.servlet.ServletSecurityElement servletSecurityElement)
      Specified by:
      setServletSecurity in interface jakarta.servlet.ServletRegistration.Dynamic
    • setStatus

      public void setStatus(int status)
      Description copied from interface: ServletEnvironment
      Set the status.
      Specified by:
      setStatus in interface ServletEnvironment
      Parameters:
      status - the status.
    • getUnavailableException

      public Throwable getUnavailableException()
      Description copied from interface: ServletEnvironment
      The exception that caused this servlet to become unavailable
      Specified by:
      getUnavailableException in interface ServletEnvironment
      Returns:
      the exception.
    • setUnavailableException

      public void setUnavailableException(Throwable unavailableException)
      Description copied from interface: ServletEnvironment
      Sets the exception that caused this servlet to become unavailable
      Specified by:
      setUnavailableException in interface ServletEnvironment
      Parameters:
      unavailableException - the unavailable exception.