public class ServletConfigImpl extends java.lang.Object implements ServletConfig, ServletRegistration.Dynamic, AlarmListener
Modifier and Type | Class and Description |
---|---|
static class |
ServletConfigImpl.FRAGMENT_MODE |
static class |
ServletConfigImpl.RunAs |
ServletRegistration.Dynamic
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
Constructor and Description |
---|
ServletConfigImpl()
Creates a new servlet configuration object.
|
ServletConfigImpl(ServletConfigImpl.FRAGMENT_MODE fragmentMode) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
addMapping(java.lang.String... urlPatterns)
Maps or exists if any of the patterns in urlPatterns already map to a
different servlet
|
void |
addSecurityRoleRef(SecurityRoleRef ref)
Adds a security role reference.
|
protected java.lang.String |
calculateServletClassName() |
void |
checkConstructor()
Checks the class constructor for the public-zero arg.
|
void |
close() |
protected void |
copyFrom(ServletConfigImpl source) |
InitParam |
createInitParam()
Sets an init-param
|
MultipartConfigImpl |
createMultipartConfig() |
ServletConfigImpl |
createRegexpConfig(java.lang.String servletName) |
RunAt |
createRunAt()
Creates the run-at configuration.
|
java.lang.Object |
createServlet()
Instantiates a servlet given its configuration.
|
FilterChain |
createServletChain() |
protected ConfigException |
error(java.lang.String msg) |
protected ConfigException |
error(java.lang.String msg,
java.lang.Throwable e) |
protected java.lang.RuntimeException |
error(java.lang.Throwable e) |
Bean<?> |
getBean() |
java.lang.String |
getClassName() |
CronType |
getCron()
Returns the cron configuration.
|
java.lang.String |
getDisplayName()
Gets the display name
|
ContainerProgram |
getInit()
Gets the init block
|
java.lang.String |
getInitParameter(java.lang.String name)
Gets the init params
|
java.util.Enumeration |
getInitParameterNames()
Gets the init params
|
java.util.Map<java.lang.String,java.lang.String> |
getInitParameters() |
java.util.Map |
getInitParamMap()
Gets the init params
|
java.lang.String |
getJspFile()
Gets the JSP file
|
int |
getLoadOnStartup()
Gets the load-on-startup value.
|
java.util.Collection<java.lang.String> |
getMappings() |
MultipartConfigElement |
getMultipartConfig() |
java.lang.String |
getName() |
java.util.HashMap<java.lang.String,java.lang.String> |
getRoleMap()
Adds a security role reference.
|
java.lang.String |
getRunAsRole() |
RunAt |
getRunAt()
Returns the run-at configuration.
|
ServletSecurityElement |
getSecurityElement() |
java.lang.Object |
getServlet()
Returns the servlet.
|
java.lang.Class |
getServletClass()
Gets the servlet class.
|
java.lang.String |
getServletClassName()
Gets the servlet name.
|
ServletContext |
getServletContext()
Returns the servlet context.
|
ServletManager |
getServletManager()
Returns the servlet manager.
|
java.lang.String |
getServletName()
Gets the servlet name.
|
java.lang.String |
getServletNameDefault()
Gets the servlet name default.
|
void |
handleAlarm(Alarm alarm)
Handles a cron alarm callback.
|
void |
init()
Initialize the servlet config.
|
boolean |
isAsyncSupported() |
boolean |
isInFragmentMode() |
boolean |
isServletConfig() |
void |
merge(ServletConfigImpl config) |
void |
setAllowEL(boolean allowEL)
Sets the allow value.
|
void |
setAsyncSupported(boolean asyncSupported) |
void |
setBean(Bean<?> bean)
Set the bean
|
void |
setConfigUriLocation(java.lang.String location,
int line)
Sets the config location.
|
void |
setCron(CronType cron) |
void |
setDescription(java.lang.String description)
Sets the description
|
void |
setDisplayName(java.lang.String displayName)
Sets the display name
|
void |
setIcon(Icon icon)
Sets the icon
|
void |
setId(java.lang.String id)
Sets the id attribute
|
void |
setInFragmentMode() |
void |
setInit(ContainerProgram init)
Sets the init block
|
void |
setInitException(ServletException exn)
Sets the init exception
|
void |
setInitParam(InitParam initParam)
Sets an init-param
|
void |
setInitParam(java.lang.String param,
java.lang.String value)
Sets an init-param
|
boolean |
setInitParameter(java.lang.String name,
java.lang.String value) |
java.util.Set<java.lang.String> |
setInitParameters(java.util.Map<java.lang.String,java.lang.String> initParameters) |
void |
setJndiName(java.lang.String jndiName) |
void |
setJspFile(java.lang.String jspFile)
Sets the JSP file
|
void |
setLoadOnStartup(int loadOnStartup)
Sets the load-on-startup
|
void |
setMultipartConfig(MultipartConfigElement multipartConfig) |
void |
setProtocol(ServletProtocolConfig protocol)
Sets the web service protocol.
|
void |
setProtocolFactory(ProtocolServletFactory factory)
Sets the web service protocol.
|
void |
setRunAs(ServletConfigImpl.RunAs runAs)
Sets the run-as
|
void |
setRunAsRole(java.lang.String roleName) |
void |
setServlet(Servlet servlet) |
void |
setServletClass(java.lang.Class<? extends Servlet> servletClass) |
void |
setServletClass(java.lang.String servletClassName)
Sets the servlet class.
|
void |
setServletContext(ServletContext app)
Sets the servlet context.
|
void |
setServletManager(ServletManager manager)
Sets the servlet manager.
|
void |
setServletMapper(ServletMapper servletMapper) |
void |
setServletName(java.lang.String name)
Sets the servlet name.
|
void |
setServletNameDefault(java.lang.String name)
Sets the servlet name default when not specified
|
java.util.Set<java.lang.String> |
setServletSecurity(ServletSecurityElement securityElement) |
void |
setVar(java.lang.String var) |
void |
setWebApp(WebApp webApp) |
java.lang.String |
toString()
Returns a printable representation of the servlet config object.
|
protected void |
validateClass(boolean requireClass) |
public ServletConfigImpl()
public ServletConfigImpl(ServletConfigImpl.FRAGMENT_MODE fragmentMode)
public void setConfigUriLocation(java.lang.String location, int line)
public void setId(java.lang.String id)
public void setServletName(java.lang.String name)
public java.lang.String getServletName()
getServletName
in interface ServletConfig
public java.lang.String getName()
getName
in interface Registration
public ServletConfigImpl createRegexpConfig(java.lang.String servletName) throws ServletException
ServletException
public java.lang.String getClassName()
getClassName
in interface Registration
public boolean setInitParameter(java.lang.String name, java.lang.String value)
setInitParameter
in interface Registration
public java.util.Set<java.lang.String> setServletSecurity(ServletSecurityElement securityElement)
setServletSecurity
in interface ServletRegistration.Dynamic
public ServletSecurityElement getSecurityElement()
public MultipartConfigImpl createMultipartConfig()
public void setMultipartConfig(MultipartConfigElement multipartConfig)
setMultipartConfig
in interface ServletRegistration.Dynamic
public MultipartConfigElement getMultipartConfig()
public java.util.Set<java.lang.String> addMapping(java.lang.String... urlPatterns)
addMapping
in interface ServletRegistration
urlPatterns
- public java.util.Collection<java.lang.String> getMappings()
getMappings
in interface ServletRegistration
public java.util.Set<java.lang.String> setInitParameters(java.util.Map<java.lang.String,java.lang.String> initParameters)
setInitParameters
in interface Registration
public java.util.Map<java.lang.String,java.lang.String> getInitParameters()
getInitParameters
in interface Registration
public void setAsyncSupported(boolean asyncSupported)
setAsyncSupported
in interface Registration.Dynamic
public boolean isAsyncSupported()
public void setServletNameDefault(java.lang.String name)
public java.lang.String getServletNameDefault()
public java.lang.String getServletClassName()
@Configurable public void setBean(Bean<?> bean)
public Bean<?> getBean()
public boolean isServletConfig()
@Configurable public void setServletClass(java.lang.String servletClassName)
@DisableConfig public void setServletClass(java.lang.Class<? extends Servlet> servletClass)
public java.lang.Class getServletClass()
protected java.lang.String calculateServletClassName()
public void setServlet(Servlet servlet)
public void setJspFile(java.lang.String jspFile)
public java.lang.String getJspFile()
public void setAllowEL(boolean allowEL)
public void setInitParam(java.lang.String param, java.lang.String value)
public InitParam createInitParam()
public void setInitParam(InitParam initParam)
public java.util.Map getInitParamMap()
public java.lang.String getInitParameter(java.lang.String name)
getInitParameter
in interface Registration
getInitParameter
in interface ServletConfig
name
- of the parameterpublic java.util.Enumeration getInitParameterNames()
getInitParameterNames
in interface ServletConfig
public void setRunAs(ServletConfigImpl.RunAs runAs)
public java.lang.String getRunAsRole()
getRunAsRole
in interface ServletRegistration
public void setRunAsRole(java.lang.String roleName)
setRunAsRole
in interface ServletRegistration.Dynamic
public ServletContext getServletContext()
getServletContext
in interface ServletConfig
public void setServletContext(ServletContext app)
public void setWebApp(WebApp webApp)
public ServletManager getServletManager()
public void setServletManager(ServletManager manager)
public void setServletMapper(ServletMapper servletMapper)
public void setInit(ContainerProgram init)
public ContainerProgram getInit()
public void setLoadOnStartup(int loadOnStartup)
setLoadOnStartup
in interface ServletRegistration.Dynamic
public int getLoadOnStartup()
public RunAt createRunAt()
public void setCron(CronType cron)
public void setJndiName(java.lang.String jndiName)
public void setVar(java.lang.String var)
public RunAt getRunAt()
public CronType getCron()
public void addSecurityRoleRef(SecurityRoleRef ref)
public java.util.HashMap<java.lang.String,java.lang.String> getRoleMap()
public void setDisplayName(java.lang.String displayName)
public java.lang.String getDisplayName()
public void setDescription(java.lang.String description)
public void setIcon(Icon icon)
public void setProtocol(ServletProtocolConfig protocol)
public void setProtocolFactory(ProtocolServletFactory factory)
public void setInitException(ServletException exn)
public void setInFragmentMode()
public boolean isInFragmentMode()
public java.lang.Object getServlet()
public void merge(ServletConfigImpl config)
@PostConstruct public void init() throws ServletException
ServletException
protected void validateClass(boolean requireClass) throws ServletException
ServletException
public void checkConstructor() throws ServletException
ServletException
public void handleAlarm(Alarm alarm)
handleAlarm
in interface AlarmListener
public FilterChain createServletChain() throws ServletException
ServletException
public java.lang.Object createServlet() throws ServletException
isNew
- ServletException
public void close()
protected ConfigException error(java.lang.String msg)
protected ConfigException error(java.lang.String msg, java.lang.Throwable e)
protected java.lang.RuntimeException error(java.lang.Throwable e)
protected void copyFrom(ServletConfigImpl source)
public java.lang.String toString()
toString
in class java.lang.Object