Registration
, Registration.Dynamic
, ServletConfig
, ServletRegistration
, ServletRegistration.Dynamic
public class DefaultServletEnvironment extends Object implements ServletRegistration.Dynamic, ServletConfig
ServletRegistration.Dynamic
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
asyncSupported |
Stores the async supported flag.
|
protected String |
className |
Stores the class name.
|
protected Map<String,String> |
initParameters |
Stores the init parameters.
|
protected int |
loadOnStartup |
Stores the load on startup value.
|
protected MultipartConfigElement |
multipartConfig |
Stores the multi-part config.
|
protected String |
runAsRole |
Stores the run-as-role.
|
protected Servlet |
servlet |
Stores the servlet.
|
protected Class |
servletClass |
Stores the servlet class.
|
protected String |
servletName |
Stores the servlet name.
|
protected int |
status |
Stores the status.
|
static int |
UNAVAILABLE |
Defines the UNAVAILABLE constant.
|
protected WebApplication |
webApp |
Stores the web application.
|
Constructor | Description |
---|---|
DefaultServletEnvironment(DefaultWebApplication webApp,
String servletName) |
Constructor.
|
DefaultServletEnvironment(DefaultWebApplication webApp,
String servletName,
Servlet servlet) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
Set<String> |
addMapping(String... urlPatterns) |
Add a mapping for the given servlet.
|
String |
getClassName() |
Get the class name.
|
String |
getInitParameter(String name) |
Get the init parameter.
|
Enumeration<String> |
getInitParameterNames() |
Get the init parameter names.
|
Map<String,String> |
getInitParameters() |
Get the init parameters.
|
int |
getLoadOnStartup() |
Get the load on startup.
|
Collection<String> |
getMappings() |
Get the mappings.
|
MultipartConfigElement |
getMultipartConfig() |
Get the multi-part config.
|
String |
getName() |
Get the servlet name.
|
String |
getRunAsRole() |
Get the "Run as Role".
|
Servlet |
getServlet() |
Get the servlet.
|
Class |
getServletClass() |
Get the servlet class.
|
ServletContext |
getServletContext() |
Get the servlet context.
|
String |
getServletName() |
Get the servlet name.
|
WebApplication |
getWebApplication() |
Get the web application.
|
boolean |
isAsyncSupported() |
Is async supported.
|
void |
setAsyncSupported(boolean asyncSupported) |
Set the async supported flag.
|
void |
setClassName(String className) |
Set the class name.
|
boolean |
setInitParameter(String name,
String value) |
Set the init parameter.
|
Set<String> |
setInitParameters(Map<String,String> initParameters) |
Set the init parameters.
|
void |
setLoadOnStartup(int loadOnStartup) |
Set the load on startup.
|
void |
setMultipartConfig(MultipartConfigElement multipartConfig) |
Set the multipart config.
|
void |
setRunAsRole(String runAsRole) |
Set the run as role.
|
void |
setServlet(Servlet servlet) |
Set the servlet.
|
Set<String> |
setServletSecurity(ServletSecurityElement servletSecurityElement) |
Set the servlet security element.
|
void |
setStatus(int status) |
Set the status.
|
public static final int UNAVAILABLE
protected boolean asyncSupported
protected String className
protected int loadOnStartup
protected MultipartConfigElement multipartConfig
protected String runAsRole
protected Servlet servlet
protected Class servletClass
protected final String servletName
protected int status
protected final WebApplication webApp
public DefaultServletEnvironment(DefaultWebApplication webApp, String servletName)
webApp
- the web application.servletName
- the serlvet name.public DefaultServletEnvironment(DefaultWebApplication webApp, String servletName, Servlet servlet)
webApp
- the web application.servletName
- the servlet name.servlet
- the servlet.public Set<String> addMapping(String... urlPatterns)
addMapping
in interface ServletRegistration
urlPatterns
- the url patterns.public String getClassName()
getClassName
in interface Registration
public String getInitParameter(String name)
getInitParameter
in interface Registration
getInitParameter
in interface ServletConfig
name
- the parameter name.public Enumeration<String> getInitParameterNames()
getInitParameterNames
in interface ServletConfig
public Map<String,String> getInitParameters()
getInitParameters
in interface Registration
public int getLoadOnStartup()
public Collection<String> getMappings()
getMappings
in interface ServletRegistration
public MultipartConfigElement getMultipartConfig()
public String getName()
getName
in interface Registration
public String getRunAsRole()
getRunAsRole
in interface ServletRegistration
public Servlet getServlet()
public ServletContext getServletContext()
getServletContext
in interface ServletConfig
public Class getServletClass()
public String getServletName()
getServletName
in interface ServletConfig
public WebApplication getWebApplication()
public boolean isAsyncSupported()
public void setAsyncSupported(boolean asyncSupported)
setAsyncSupported
in interface Registration.Dynamic
asyncSupported
- the async supported flag.public void setClassName(String className)
className
- the class name.public boolean setInitParameter(String name, String value)
setInitParameter
in interface Registration
name
- the parameter name.value
- the parameter value.public Set<String> setInitParameters(Map<String,String> initParameters)
setInitParameters
in interface Registration
initParameters
- the init parameters.public void setLoadOnStartup(int loadOnStartup)
setLoadOnStartup
in interface ServletRegistration.Dynamic
loadOnStartup
- the load on startup.public void setMultipartConfig(MultipartConfigElement multipartConfig)
setMultipartConfig
in interface ServletRegistration.Dynamic
multipartConfig
- the multipart config.public void setRunAsRole(String runAsRole)
setRunAsRole
in interface ServletRegistration.Dynamic
runAsRole
- the run as role.public void setServlet(Servlet servlet)
servlet
- the servlet.public Set<String> setServletSecurity(ServletSecurityElement servletSecurityElement)
setServletSecurity
in interface ServletRegistration.Dynamic
servletSecurityElement
- the servlet security element.public void setStatus(int status)
status
- the status.Copyright © 2020 Piranha Cloud. All rights reserved.