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
The default ServletEnvironment.
- Author:
- Manfred Riem ([email protected])
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.servlet.Registration
jakarta.servlet.Registration.Dynamic
Nested classes/interfaces inherited from interface jakarta.servlet.ServletRegistration
jakarta.servlet.ServletRegistration.Dynamic
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Stores the async supported flag.protected String
Stores the class name.Stores the init parameters.protected int
Stores the load on startup value.protected jakarta.servlet.MultipartConfigElement
Stores the multi-part config.protected String
Stores the run-as-role.protected jakarta.servlet.Servlet
Stores the servlet.protected Class<? extends jakarta.servlet.Servlet>
Stores the servlet class.protected final String
Stores the servlet name.protected int
Stores the status.protected Throwable
Stores the unavailableException.protected final WebApplication
Stores the web application.Fields inherited from interface cloud.piranha.core.api.ServletEnvironment
UNAVAILABLE
-
Constructor Summary
ConstructorDescriptionDefaultServletEnvironment
(DefaultWebApplication webApp, String servletName) Constructor.DefaultServletEnvironment
(DefaultWebApplication webApp, String servletName, jakarta.servlet.Servlet servlet) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddMapping
(String... urlPatterns) getInitParameter
(String name) int
Returns the load on startup.jakarta.servlet.MultipartConfigElement
Returns the multi-part config.getName()
jakarta.servlet.Servlet
Returns the servlet.Class<? extends jakarta.servlet.Servlet>
Returns the servlet class.jakarta.servlet.ServletContext
int
Returns the status.The exception that caused this servlet to become unavailableReturns the web application.boolean
Is async supported.void
setAsyncSupported
(boolean asyncSupported) void
setClassName
(String className) Set the class name.boolean
setInitParameter
(String name, String value) setInitParameters
(Map<String, String> initParameters) void
setLoadOnStartup
(int loadOnStartup) void
setMultipartConfig
(jakarta.servlet.MultipartConfigElement multipartConfig) void
setRunAsRole
(String runAsRole) void
setServlet
(jakarta.servlet.Servlet servlet) Set the servlet.setServletSecurity
(jakarta.servlet.ServletSecurityElement servletSecurityElement) void
setStatus
(int status) Set the status.void
setUnavailableException
(Throwable unavailableException) Sets the exception that caused this servlet to become unavailable
-
Field Details
-
asyncSupported
protected boolean asyncSupportedStores the async supported flag. -
className
Stores the class name. -
initParameters
Stores the init parameters. -
loadOnStartup
protected int loadOnStartupStores the load on startup value. -
multipartConfig
protected jakarta.servlet.MultipartConfigElement multipartConfigStores the multi-part config. -
runAsRole
Stores the run-as-role. -
servlet
protected jakarta.servlet.Servlet servletStores the servlet. -
servletClass
Stores the servlet class. -
servletName
Stores the servlet name. -
status
protected int statusStores the status. -
webApp
Stores the web application.
-
-
Constructor Details
-
DefaultServletEnvironment
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
- Specified by:
addMapping
in interfacejakarta.servlet.ServletRegistration
-
getClassName
- Specified by:
getClassName
in interfacejakarta.servlet.Registration
-
getInitParameter
- Specified by:
getInitParameter
in interfacejakarta.servlet.Registration
- Specified by:
getInitParameter
in interfacejakarta.servlet.ServletConfig
-
getInitParameterNames
- Specified by:
getInitParameterNames
in interfacejakarta.servlet.ServletConfig
-
getInitParameters
- Specified by:
getInitParameters
in interfacejakarta.servlet.Registration
-
getLoadOnStartup
public int getLoadOnStartup()Description copied from interface:ServletEnvironment
Returns the load on startup.- Specified by:
getLoadOnStartup
in interfaceServletEnvironment
- Returns:
- the load on startup
-
getMappings
- Specified by:
getMappings
in interfacejakarta.servlet.ServletRegistration
-
getMultipartConfig
public jakarta.servlet.MultipartConfigElement getMultipartConfig()Description copied from interface:ServletEnvironment
Returns the multi-part config.- Specified by:
getMultipartConfig
in interfaceServletEnvironment
- Returns:
- the multi-part config
-
getName
- Specified by:
getName
in interfacejakarta.servlet.Registration
-
getRunAsRole
- Specified by:
getRunAsRole
in interfacejakarta.servlet.ServletRegistration
-
getServlet
public jakarta.servlet.Servlet getServlet()Description copied from interface:ServletEnvironment
Returns the servlet.- Specified by:
getServlet
in interfaceServletEnvironment
- Returns:
- the servlet
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()- Specified by:
getServletContext
in interfacejakarta.servlet.ServletConfig
-
getServletClass
Description copied from interface:ServletEnvironment
Returns the servlet class.- Specified by:
getServletClass
in interfaceServletEnvironment
- Returns:
- the servlet class
-
getServletName
- Specified by:
getServletName
in interfacejakarta.servlet.ServletConfig
-
getStatus
public int getStatus()Description copied from interface:ServletEnvironment
Returns the status.- Specified by:
getStatus
in interfaceServletEnvironment
- Returns:
- the status
-
getWebApplication
Description copied from interface:ServletEnvironment
Returns the web application.- Specified by:
getWebApplication
in interfaceServletEnvironment
- Returns:
- the web application
-
isAsyncSupported
public boolean isAsyncSupported()Description copied from interface:ServletEnvironment
Is async supported.- Specified by:
isAsyncSupported
in interfaceServletEnvironment
- Returns:
- true if it is, false otherwise.
-
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported) - Specified by:
setAsyncSupported
in interfacejakarta.servlet.Registration.Dynamic
-
setClassName
Description copied from interface:ServletEnvironment
Set the class name.- Specified by:
setClassName
in interfaceServletEnvironment
- Parameters:
className
- the class name.
-
setInitParameter
- Specified by:
setInitParameter
in interfacejakarta.servlet.Registration
-
setInitParameters
- Specified by:
setInitParameters
in interfacejakarta.servlet.Registration
-
setLoadOnStartup
public void setLoadOnStartup(int loadOnStartup) - Specified by:
setLoadOnStartup
in interfacejakarta.servlet.ServletRegistration.Dynamic
-
setMultipartConfig
public void setMultipartConfig(jakarta.servlet.MultipartConfigElement multipartConfig) - Specified by:
setMultipartConfig
in interfacejakarta.servlet.ServletRegistration.Dynamic
-
setRunAsRole
- Specified by:
setRunAsRole
in interfacejakarta.servlet.ServletRegistration.Dynamic
-
setServlet
public void setServlet(jakarta.servlet.Servlet servlet) Description copied from interface:ServletEnvironment
Set the servlet.- Specified by:
setServlet
in interfaceServletEnvironment
- Parameters:
servlet
- the servlet.
-
setServletSecurity
public Set<String> setServletSecurity(jakarta.servlet.ServletSecurityElement servletSecurityElement) - Specified by:
setServletSecurity
in interfacejakarta.servlet.ServletRegistration.Dynamic
-
setStatus
public void setStatus(int status) Description copied from interface:ServletEnvironment
Set the status.- Specified by:
setStatus
in interfaceServletEnvironment
- Parameters:
status
- the status.
-