com.caucho.server.webapp
Class WebApp

java.lang.Object
  extended by com.caucho.server.webapp.ServletContextCompat
      extended by com.caucho.server.webapp.ServletContextImpl
          extended by com.caucho.server.webapp.WebApp
All Implemented Interfaces:
SchemaBean, DeployInstance, EnvironmentDeployInstance, EnvironmentBean, InvocationBuilder, Dependency, java.io.Serializable, JspConfigDescriptor, ServletContext
Direct Known Subclasses:
UnknownWebApp

@Configurable
public class WebApp
extends ServletContextImpl
implements Dependency, EnvironmentBean, SchemaBean, InvocationBuilder, EnvironmentDeployInstance, JspConfigDescriptor, java.io.Serializable

Resin's webApp implementation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.servlet.ServletContext
ORDERED_LIBS, TEMPDIR
 
Method Summary
 void accessLog(HttpServletRequest req, HttpServletResponse res)
          Access logging for high-level errors
 void add(AbstractAccessLog log)
          Allow custom access log
 void add(DispatchRule rule)
          Adds a rewrite dispatch rule
 void add(RewriteFilter filter)
          Adds a rewrite dispatch rule
 void add(SecurityConstraint constraint)
           
 void addCacheMapping(CacheMapping mapping)
          Returns the maximum length for a cache.
 void addConfigFile(Path path)
          Backwards compatability for config-file.
 void addContextParam(InitParam initParam)
          Sets the context param
 void addErrorPage(ErrorPage errorPage)
          Adds an error page
 void addFilter(FilterConfigImpl config)
          Adds a filter configuration.
 FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.Class<? extends Filter> filterClass)
          Adds a filter using filterClass
 FilterRegistration.Dynamic addFilter(java.lang.String filterName, Filter filter)
          Adds a dynamic filter registration using filter
 FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.String className)
          Adds a dynamic filter registration using className
 void addFilter(WebFilter webFilter, java.lang.String filterClassName)
           
 void addFilterMapping(FilterMapping filterMapping)
          Adds a filter-mapping configuration.
 void addJspConfig(JspConfig config)
          jsp-config configuration
 void addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
           
 void addListener(ListenerConfig listener)
           
 void addListener(java.lang.String className)
           
<T extends java.util.EventListener>
void
addListener(T listener)
           
 void addMimeMapping(MimeMapping mimeMapping)
          Adds a mime-mapping
 void addPathMapping(PathMapping pathMapping)
          Adds a path-mapping
 void addPersistenceContextRef(PersistenceContextRefConfig persistenceContextRefConfig)
          Adds a persistence-context-ref configuration.
 void addResourceRef(ResourceRef ref)
          Adds a ResourceRef validator.
 void addRewriteDispatch(RewriteDispatch dispatch)
          Adds rewrite-dispatch.
 void addSecurityConstraint(SecurityConstraint constraint)
          Adds a security constraint
 void addSecurityRole(SecurityRole role)
          Adds a security role
 void addServlet(ServletConfigImpl config)
          Adds a servlet configuration.
 ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.Class<? extends Servlet> servletClass)
          Adds a servlet class to the servlet container.
 ServletRegistration.Dynamic addServlet(java.lang.String servletName, Servlet servlet)
          Adds a servlet to context
 ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.String className)
          Adds a servlet with the given className to context
 void addServlet(WebServlet webServlet, java.lang.String servletClassName)
           
 void addServletMapping(ServletMapping servletMapping)
          Adds a servlet-mapping configuration.
 void addServletRegexp(ServletRegexp servletRegexp)
          Adds a servlet-regexp configuration.
 void addSessionConfig(SessionManager manager)
          Adds the session manager.
 void addStatus500()
           
 void addTaglib(JspTaglib taglib)
          taglib configuration
 void addWebApp(WebAppConfig config)
          Adds a sub web-app
 void addWebAppDefault(WebAppConfig config)
          Adds a web-app default
 void addWebAppDeploy(WebAppExpandDeployGenerator deploy)
          Adds a war generator
 void addWelcomeFileList(WelcomeFileList list)
          Adds a welcome file list to the webApp.
 void buildDispatchInvocation(Invocation invocation)
          Fills the invocation for a rewrite-dispatch/dispatch request.
 void buildDispatchInvocation(Invocation invocation, FilterMapper filterMapper)
          Fills the invocation for subrequests.
 void buildErrorInvocation(Invocation invocation)
          Fills the invocation for an error request.
 void buildForwardInvocation(Invocation invocation)
          Fills the invocation for a forward request.
 void buildIncludeInvocation(Invocation invocation)
          Fills the invocation for an include request.
 Invocation buildInvocation(Invocation invocation)
          Fills the servlet instance.
 void buildLoginInvocation(Invocation invocation)
          Fills the invocation for a login request.
 void clearCache()
          Clears all caches, including the invocation cache, the filter cache, and the proxy cache.
 Ordering createAbsoluteOrdering()
           
 AccessLog createAccessLog()
          Sets the access log.
 InitParam createContextParam()
          Sets an init-param
 EjbLocalRef createEjbLocalRef()
          ejb-local-ref configuration
 EjbRef createEjbRef()
          ejb-ref configuration
<T extends Filter>
T
createFilter(java.lang.Class<T> filterClass)
          Create a filter using class
 JsfPropertyGroup createJsf()
          jsf configuration
 JspPropertyGroup createJsp()
          jsp configuration
 JspConfig createJspConfig()
           
<T extends java.util.EventListener>
T
createListener(java.lang.Class<T> listenerClass)
           
 LocaleEncodingMappingList createLocaleEncodingMappingList()
          Configures the locale encoding.
 MultipartForm createMultipartForm()
          Multipart form config.
 Ordering createOrdering()
           
 RewriteDispatch createRewriteDispatch()
          Adds rewrite-dispatch (backwards compat).
 RewriteRealPath createRewriteRealPath()
          Adds rewrite-real-path.
 ServletConfigImpl createServlet()
          Adds a servlet configuration.
<T extends Servlet>
T
createServlet(java.lang.Class<T> servletClass)
          Creates a servlet instance using the web-apps injection.
 ServletMapping createServletMapping()
           
 SessionManager createSessionConfig()
          Configures the session manager.
 WebAppExpandDeployGenerator createWebAppDeploy()
          Sets the war-expansion
 void destroy()
          Closes the webApp.
 java.lang.String generateCookieDomain(HttpServletRequest request)
           
 AbstractAccessLog getAccessLog()
          Returns the access log
 int getActiveSessionCount()
          Returns the active session count.
 WebAppAdmin getAdmin()
           
 Authenticator getAuthenticator()
          Gets the authenticator
 InjectManager getBeanManager()
           
 long getCacheMaxLength()
          Returns the maximum length for a cache.
 java.lang.String getCharacterEncoding()
          Returns the character encoding.
 java.lang.ClassLoader getClassLoader()
          Gets the environment class loader.
 java.lang.String[] getClassLoaderHackPackages()
          Returns the classloader hack packages.
 java.lang.Throwable getConfigException()
          Gets the config exception.
 Authenticator getConfiguredAuthenticator()
          Gets the authenticator
 Login getConfiguredLogin()
           
 ServletContext getContext(java.lang.String uri)
          Returns the servlet context for the URI.
 java.lang.String getContextPath()
          Gets the context path
 WebAppController getController()
           
 boolean getCookieHttpOnly()
          Sets the cookie-http-only
static WebApp getCurrent()
          Returns the local webApp.
 java.lang.String getDescription()
          A user description of the web-app
 boolean getDispatchWrapsFilters()
          Get true if includes wrap filters.
 EnvironmentClassLoader getEnvironmentClassLoader()
          Gets the environment class loader.
 ErrorPageManager getErrorPageManager()
          Gets the error page manager.
 java.lang.Object getExtension(java.lang.String key)
          Returns an extension.
 FilterRegistration getFilterRegistration(java.lang.String filterName)
          Returns filter registration sing filterName
 java.util.Map<java.lang.String,? extends FilterRegistration> getFilterRegistrations()
          Returns filter registrations
 long getFormParameterLengthMax()
          Returns the form upload max.
 int getFormParameterMax()
           
 long getFormUploadMax()
          Returns the form upload max.
 Host getHost()
          Returns the owning host.
 HostMXBean getHostAdmin()
          Gets the URL
 java.lang.String getHostName()
          Gets the URL
 java.lang.String getId()
          Gets the URL
 InvocationDecoder getInvocationDecoder()
           
 DependencyContainer getInvocationDependency()
          Gets the dependency container
 JsfPropertyGroup getJsf()
          Returns the JSF configuration
 JspPropertyGroup getJsp()
          Returns the JSP configuration.
 JspApplicationContextImpl getJspApplicationContext()
          Returns the JspApplicationContext for EL evaluation.
 JspConfigDescriptor getJspConfigDescriptor()
           
 java.util.Collection<JspPropertyGroupDescriptor> getJspPropertyGroups()
           
static WebApp getLocal()
          Returns the local webApp.
 java.lang.String getLocaleEncoding(java.util.Locale locale)
          Returns the locale encoding.
 Login getLogin()
          Gets the login manager.
 RequestDispatcher getLoginDispatcher(java.lang.String url)
          Returns a dispatcher for the named servlet.
 long getMaxAge(java.lang.String uri)
          Returns the time for a cache mapping.
 java.lang.String getMimeType(java.lang.String uri)
          Returns the mime type for a uri
 java.lang.String getMimeTypeImpl(java.lang.String ext)
          Maps from a URI to a real path.
 java.lang.String getModuleName()
           
 RequestDispatcher getNamedDispatcher(java.lang.String servletName)
          Returns a dispatcher for the named servlet.
 javax.management.ObjectName getObjectName()
          Returns the ObjectName.
 WebAppContainer getParent()
          Gets the parent container.
 java.lang.String getRealPath(java.lang.String uri)
          Maps from a URI to a real path.
 java.lang.String getRealPathImpl(java.lang.String uri)
          Maps from a URI to a real path.
 java.util.ArrayList<java.lang.String> getRegexp()
          Gets the regexp vars.
 ServletRequestAttributeListener[] getRequestAttributeListeners()
          Returns the request attribute listeners.
 int getRequestCount()
          Returns the request count.
 RequestDispatcherImpl getRequestDispatcher(java.lang.String url)
          Returns a dispatcher for the named servlet.
 ServletRequestListener[] getRequestListeners()
          Returns the request listeners.
 RoleMapManager getRoleMapManager()
          Returns the RoleMapManager
 Path getRootDirectory()
          Gets the webApp directory.
 java.lang.String getSchema()
          Returns the relax schema.
 Server getServer()
          Gets the dispatch server.
 java.util.ArrayList<java.lang.String> getServletIgnoreMappingPatterns()
          Returns the best matching servlet pattern.
 ServletMapper getServletMapper()
           
 java.util.ArrayList<java.lang.String> getServletMappingPatterns()
          Returns the best matching servlet pattern.
 java.lang.String getServletPattern(java.lang.String uri)
          Returns the best matching servlet pattern.
 ServletRegistration getServletRegistration(java.lang.String servletName)
          Returs servlet registration using servletName
 java.util.Map<java.lang.String,ServletRegistration> getServletRegistrations()
          Returns servlet registrations
 SessionCookieConfig getSessionCookieConfig()
          Sets the session cookie configuration
 SessionManager getSessionManager()
          Gets the session manager.
 long getSMaxAge(java.lang.String uri)
          Returns the time for a cache mapping.
 java.lang.String getState()
          Returns true if the webApp is active.
 boolean getStrictMapping()
          Get the strict mapping setting.
 java.util.ArrayList<JspTaglib> getTaglibList()
          Returns the taglib configuration.
 java.util.Collection<TaglibDescriptor> getTaglibs()
           
static ServletRequest getThreadRequest()
           
 java.lang.String getURL()
          Gets the URL
 java.lang.String getVersion()
          Returns the servlet version.
 java.lang.String getWarName()
           
 java.util.ArrayList<WebAppConfig> getWebAppDefaultList()
          Adds a web-app default
 java.util.ArrayList<java.lang.String> getWelcomeFileList()
           
 boolean hasListener(java.lang.Class<?> listenerClass)
          Returns true if a listener with the given type exists.
 boolean hasPre23Config()
          Returns true for JSP 1.x
 void init()
          Initializes.
 void initAnnotated()
           
 void initWebFragments()
           
 boolean isActive()
          Returns true if the webApp is active.
 boolean isAllowForwardAfterFlush()
           
 boolean isAllowInitParamOverride()
           
 boolean isApplyingWebFragments()
           
 boolean isClosed()
          Returns true if it's closed.
 boolean isCompileContext()
           
 boolean isDeployError()
          Returns true if the webApp deployed with an error.
 boolean isDeployIdle()
          Returns true if the deployment is idle.
 boolean isDynamicDeploy()
          Set true for a dynamically deployed server.
 boolean isFacesServletConfigured()
           
 boolean isIgnoreClientDisconnect()
          Returns true if should ignore client disconnect.
 boolean isInheritSession()
          Gets inherit session.
 boolean isInit()
          Returns true if it's init.
 boolean isInitializing()
          Returns true if it's in the middle of initializing
 boolean isMetadataComplete()
           
 boolean isModified()
          Returns true if the webApp has been modified.
 boolean isModifiedNow()
          Returns true if the webApp has been modified.
 boolean isMultipartFormEnabled()
          Returns true if multipart forms are enabled.
 java.lang.Boolean isRequestSecure()
           
 boolean isSecure()
           
 boolean isVersionAlias()
           
 void log(java.lang.String message, java.lang.Throwable e)
          Error logging
 boolean logModified(java.util.logging.Logger log)
          Log the reason for modification.
 void preConfigInit()
          Initialization before configuration
 void putLocaleEncoding(java.lang.String locale, java.lang.String encoding)
          Adds a locale-mapping
 void runInSessionContext(java.lang.String sessionId, java.lang.Runnable task)
          Runs a thread in a session context
 void setAccessLog(AbstractAccessLog log)
          Sets the access log.
 void setActiveWaitTime(Period wait)
          Sets the delay time waiting for a restart
 void setAllowForwardAfterFlush(boolean allowForwardAfterFlush)
           
 void setAllowServletEL(boolean allow)
          Sets the servlet init-param EL enabling.
 void setAppDir(Path appDir)
          Sets the webApp directory.
 void setCompileContext(boolean isCompile)
           
 void setConfigException(java.lang.Throwable e)
          Sets the config exception.
 void setConfigNode(org.w3c.dom.Node node)
          Sets the node for testing Servlet/JSP versions.
 void setCookieHttpOnly(boolean isHttpOnly)
          Sets the cookie-http-only
 void setDescription(java.lang.String description)
          A user description of the web-app
 void setDirectoryServlet(java.lang.String className)
          (compat) sets the directory servlet
 void setDisableCrossContext(boolean isDisable)
          If true, disables getContext().
 void setDisableStart(boolean isDisable)
           
 void setDispatchWrapsFilters(boolean wrap)
          Set true if includes wrap filters.
 void setDistributable(boolean isDistributable)
           
 void setDocumentDirectory(Path appDir)
          Sets the document directory (app-dir).
 void setDynamicDeploy(boolean isDynamicDeploy)
          Set true for a dynamically deployed server.
 void setEnvironmentClassLoader(EnvironmentClassLoader loader)
          Sets the environment class loader.
 void setFormParameterMax(int max)
          Sets the maximum number of form parameters
 void setIcon(Icon icon)
          Sets the icon
 void setId(java.lang.String id)
          The id is the context path.
 void setIdleTime(Period idle)
          Sets the delay time waiting for requests to end.
 void setInheritSession(boolean isInheritSession)
          Sets inherit session.
 void setLazyServletValidate(boolean isLazy)
          Lazy servlet validation.
 void setLogin(Login login)
          Sets the login
 void setLoginConfig(LoginConfig loginConfig)
          Sets the login
 void setMetadataComplete(boolean metadataComplete)
           
 void setModuleName(java.lang.String moduleName)
           
 void setOldWebApp(WebApp oldWebApp, long expireTime)
          Sets the old version web-app.
 void setParent(WebAppContainer parent)
          Sets the parent container.
 void setRedeployMode(DeployMode mode)
          Sets the redeploy-mode of the controller
 void setRegexp(java.util.ArrayList<java.lang.String> regexp)
          Sets the regexp vars.
 void setRootDirectory(Path appDir)
          Sets the root directory (app-dir).
 void setSchemaLocation(java.lang.String location)
          Sets the schema location.
 void setSecure(boolean isSecure)
          Sets the secure requirement.
 void setShutdownWaitMax(Period wait)
          Sets the delay time waiting for requests to end.
 void setStatisticsEnable(boolean isEnable)
          Enables detailed statistics
 void setStrictMapping(boolean isStrict)
          Set true if strict mapping.
 void setTempDir(Path path)
          Sets the temporary directory
 void setVersion(java.lang.String version)
          Sets the servlet version.
 void start()
          Starts the deployment instance
 void stop()
          Stops the webApp.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.server.webapp.ServletContextImpl
addAttributeListener, declareRoles, getAttribute, getAttributeNames, getCauchoPath, getEffectiveMajorVersion, getEffectiveMinorVersion, getInitParameter, getInitParameterNames, getMajorVersion, getMinorVersion, getResource, getResource, getResourceAsStream, getResourcePaths, getServerInfo, getServlet, getServletContextName, getServletNames, getServlets, log, log, removeAttribute, setAttribute, setDisplayName, setInitParam, setInitParameter, setSessionTrackingModes
 
Methods inherited from class com.caucho.server.webapp.ServletContextCompat
getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, setSessionTrackingModes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletContext
getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes
 

Method Detail

preConfigInit

public void preConfigInit()
Initialization before configuration

Specified by:
preConfigInit in interface EnvironmentDeployInstance

setParent

public void setParent(WebAppContainer parent)
Sets the parent container.


setDynamicDeploy

public void setDynamicDeploy(boolean isDynamicDeploy)
Set true for a dynamically deployed server.


isDynamicDeploy

public boolean isDynamicDeploy()
Set true for a dynamically deployed server.


getParent

public WebAppContainer getParent()
Gets the parent container.


getHost

public Host getHost()
Returns the owning host.


getLocal

public static WebApp getLocal()
Returns the local webApp.


getCurrent

public static WebApp getCurrent()
Returns the local webApp.


getServer

public Server getServer()
Gets the dispatch server.


getController

public WebAppController getController()

getModuleName

public java.lang.String getModuleName()

setModuleName

public void setModuleName(java.lang.String moduleName)

getInvocationDecoder

public InvocationDecoder getInvocationDecoder()

getBeanManager

public InjectManager getBeanManager()

setId

public void setId(java.lang.String id)
The id is the context path.


getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the environment class loader.

Specified by:
getClassLoader in interface DeployInstance
Specified by:
getClassLoader in interface EnvironmentBean
Specified by:
getClassLoader in interface ServletContext
Overrides:
getClassLoader in class ServletContextImpl

setEnvironmentClassLoader

public void setEnvironmentClassLoader(EnvironmentClassLoader loader)
Sets the environment class loader.


getEnvironmentClassLoader

public EnvironmentClassLoader getEnvironmentClassLoader()
Gets the environment class loader.


setRedeployMode

@Configurable
public void setRedeployMode(DeployMode mode)
Sets the redeploy-mode of the controller


getSchema

public java.lang.String getSchema()
Returns the relax schema.

Specified by:
getSchema in interface SchemaBean

setStatisticsEnable

@Configurable
public void setStatisticsEnable(boolean isEnable)
Enables detailed statistics


setConfigNode

public void setConfigNode(org.w3c.dom.Node node)
Sets the node for testing Servlet/JSP versions.


getRootDirectory

public Path getRootDirectory()
Gets the webApp directory.

Overrides:
getRootDirectory in class ServletContextImpl

getInvocationDependency

public DependencyContainer getInvocationDependency()
Gets the dependency container


setRegexp

public void setRegexp(java.util.ArrayList<java.lang.String> regexp)
Sets the regexp vars.


getRegexp

public java.util.ArrayList<java.lang.String> getRegexp()
Gets the regexp vars.


setDocumentDirectory

public void setDocumentDirectory(Path appDir)
Sets the document directory (app-dir).


setRootDirectory

@Configurable
public void setRootDirectory(Path appDir)
Sets the root directory (app-dir).


setAppDir

public void setAppDir(Path appDir)
Sets the webApp directory.


getObjectName

public javax.management.ObjectName getObjectName()
Returns the ObjectName.


getWarName

public java.lang.String getWarName()

getContextPath

public java.lang.String getContextPath()
Gets the context path

Specified by:
getContextPath in interface ServletContext
Overrides:
getContextPath in class ServletContextImpl

setVersion

@Configurable
public void setVersion(java.lang.String version)
Sets the servlet version.


getVersion

public java.lang.String getVersion()
Returns the servlet version.


setSchemaLocation

public void setSchemaLocation(java.lang.String location)
Sets the schema location.


setDisableStart

public void setDisableStart(boolean isDisable)

isMetadataComplete

public boolean isMetadataComplete()

setMetadataComplete

public void setMetadataComplete(boolean metadataComplete)

setDistributable

@Configurable
public void setDistributable(boolean isDistributable)

getURL

public java.lang.String getURL()
Gets the URL


getId

public java.lang.String getId()
Gets the URL


getHostName

public java.lang.String getHostName()
Gets the URL


getHostAdmin

public HostMXBean getHostAdmin()
Gets the URL


getDescription

public java.lang.String getDescription()
A user description of the web-app


setDescription

@Configurable
public void setDescription(java.lang.String description)
A user description of the web-app


setIcon

@Configurable
public void setIcon(Icon icon)
Sets the icon


setAllowServletEL

@Configurable
public void setAllowServletEL(boolean allow)
Sets the servlet init-param EL enabling.


isAllowForwardAfterFlush

@Configurable
public boolean isAllowForwardAfterFlush()

setAllowForwardAfterFlush

public void setAllowForwardAfterFlush(boolean allowForwardAfterFlush)

setDisableCrossContext

@Configurable
public void setDisableCrossContext(boolean isDisable)
If true, disables getContext().


setCompileContext

public void setCompileContext(boolean isCompile)

isCompileContext

public boolean isCompileContext()

isVersionAlias

public boolean isVersionAlias()

setOldWebApp

public void setOldWebApp(WebApp oldWebApp,
                         long expireTime)
Sets the old version web-app.


createAbsoluteOrdering

public Ordering createAbsoluteOrdering()

createOrdering

@Configurable
public Ordering createOrdering()

createServlet

public ServletConfigImpl createServlet()
                                throws ServletException
Adds a servlet configuration.

Throws:
ServletException

addServlet

@Configurable
public void addServlet(ServletConfigImpl config)
                throws ServletException
Adds a servlet configuration.

Throws:
ServletException

createServlet

public <T extends Servlet> T createServlet(java.lang.Class<T> servletClass)
                                throws ServletException
Description copied from interface: ServletContext
Creates a servlet instance using the web-apps injection.

Specified by:
createServlet in interface ServletContext
Overrides:
createServlet in class ServletContextImpl
Throws:
ServletException

addServlet

public void addServlet(WebServlet webServlet,
                       java.lang.String servletClassName)
                throws ServletException
Throws:
ServletException

addServlet

public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
                                              java.lang.String className)
Description copied from interface: ServletContext
Adds a servlet with the given className to context

Specified by:
addServlet in interface ServletContext
Overrides:
addServlet in class ServletContextImpl

addServlet

public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
                                              java.lang.Class<? extends Servlet> servletClass)
Description copied from interface: ServletContext
Adds a servlet class to the servlet container.

Specified by:
addServlet in interface ServletContext
Overrides:
addServlet in class ServletContextImpl

addServlet

public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
                                              Servlet servlet)
Description copied from interface: ServletContext
Adds a servlet to context

Specified by:
addServlet in interface ServletContext
Overrides:
addServlet in class ServletContextImpl

getServletRegistration

public ServletRegistration getServletRegistration(java.lang.String servletName)
Description copied from interface: ServletContext
Returs servlet registration using servletName

Specified by:
getServletRegistration in interface ServletContext
Overrides:
getServletRegistration in class ServletContextImpl
Returns:
a ServletRegistration object

getServletRegistrations

public java.util.Map<java.lang.String,ServletRegistration> getServletRegistrations()
Description copied from interface: ServletContext
Returns servlet registrations

Specified by:
getServletRegistrations in interface ServletContext
Overrides:
getServletRegistrations in class ServletContextImpl
Returns:

createFilter

public <T extends Filter> T createFilter(java.lang.Class<T> filterClass)
                              throws ServletException
Description copied from interface: ServletContext
Create a filter using class

Specified by:
createFilter in interface ServletContext
Overrides:
createFilter in class ServletContextImpl
Returns:
Throws:
ServletException

addFilter

public void addFilter(WebFilter webFilter,
                      java.lang.String filterClassName)
               throws java.lang.Exception
Throws:
java.lang.Exception

addFilter

public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
                                            java.lang.String className)
Description copied from interface: ServletContext
Adds a dynamic filter registration using className

Specified by:
addFilter in interface ServletContext
Overrides:
addFilter in class ServletContextImpl
Returns:

addFilter

public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
                                            java.lang.Class<? extends Filter> filterClass)
Description copied from interface: ServletContext
Adds a filter using filterClass

Specified by:
addFilter in interface ServletContext
Overrides:
addFilter in class ServletContextImpl
Returns:

addFilter

public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
                                            Filter filter)
Description copied from interface: ServletContext
Adds a dynamic filter registration using filter

Specified by:
addFilter in interface ServletContext
Overrides:
addFilter in class ServletContextImpl
Returns:

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns the character encoding.


setStrictMapping

@Configurable
public void setStrictMapping(boolean isStrict)
                      throws ServletException
Set true if strict mapping.

Throws:
ServletException

getStrictMapping

public boolean getStrictMapping()
Get the strict mapping setting.


setLazyServletValidate

@Configurable
public void setLazyServletValidate(boolean isLazy)
Lazy servlet validation.


createServletMapping

public ServletMapping createServletMapping()

addServletMapping

@Configurable
public void addServletMapping(ServletMapping servletMapping)
                       throws ServletException
Adds a servlet-mapping configuration.

Throws:
ServletException

addServletRegexp

@Configurable
public void addServletRegexp(ServletRegexp servletRegexp)
                      throws ServletException,
                             java.lang.ClassNotFoundException
Adds a servlet-regexp configuration.

Throws:
ServletException
java.lang.ClassNotFoundException

addFilter

@Configurable
public void addFilter(FilterConfigImpl config)
Adds a filter configuration.


addFilterMapping

@Configurable
public void addFilterMapping(FilterMapping filterMapping)
                      throws ServletException
Adds a filter-mapping configuration.

Throws:
ServletException

getFilterRegistration

public FilterRegistration getFilterRegistration(java.lang.String filterName)
Description copied from interface: ServletContext
Returns filter registration sing filterName

Specified by:
getFilterRegistration in interface ServletContext
Overrides:
getFilterRegistration in class ServletContextImpl
Returns:

getFilterRegistrations

public java.util.Map<java.lang.String,? extends FilterRegistration> getFilterRegistrations()
Returns filter registrations

Specified by:
getFilterRegistrations in interface ServletContext
Overrides:
getFilterRegistrations in class ServletContextImpl
Returns:

addPersistenceContextRef

public void addPersistenceContextRef(PersistenceContextRefConfig persistenceContextRefConfig)
                              throws ServletException
Adds a persistence-context-ref configuration.

Throws:
ServletException

setDispatchWrapsFilters

@Configurable
public void setDispatchWrapsFilters(boolean wrap)
Set true if includes wrap filters.


getDispatchWrapsFilters

public boolean getDispatchWrapsFilters()
Get true if includes wrap filters.


setDirectoryServlet

public void setDirectoryServlet(java.lang.String className)
                         throws java.lang.Exception
(compat) sets the directory servlet

Throws:
java.lang.Exception

addWelcomeFileList

@Configurable
public void addWelcomeFileList(WelcomeFileList list)
Adds a welcome file list to the webApp.


getWelcomeFileList

public java.util.ArrayList<java.lang.String> getWelcomeFileList()

createLocaleEncodingMappingList

@Configurable
public LocaleEncodingMappingList createLocaleEncodingMappingList()
Configures the locale encoding.


setInheritSession

public void setInheritSession(boolean isInheritSession)
Sets inherit session.


isInheritSession

public boolean isInheritSession()
Gets inherit session.


createSessionConfig

public SessionManager createSessionConfig()
                                   throws java.lang.Exception
Configures the session manager.

Throws:
java.lang.Exception

addSessionConfig

@Configurable
public void addSessionConfig(SessionManager manager)
                      throws ConfigException
Adds the session manager.

Throws:
ConfigException

setCookieHttpOnly

@Configurable
public void setCookieHttpOnly(boolean isHttpOnly)
Sets the cookie-http-only


getCookieHttpOnly

public boolean getCookieHttpOnly()
Sets the cookie-http-only


createContextParam

public InitParam createContextParam()
Sets an init-param


addContextParam

@Configurable
public void addContextParam(InitParam initParam)
Sets the context param


addErrorPage

@Configurable
public void addErrorPage(ErrorPage errorPage)
Adds an error page


createAccessLog

public AccessLog createAccessLog()
Sets the access log.


setAccessLog

@Configurable
public void setAccessLog(AbstractAccessLog log)
Sets the access log.


add

@Configurable
public void add(AbstractAccessLog log)
Allow custom access log


setFormParameterMax

@Configurable
public void setFormParameterMax(int max)
Sets the maximum number of form parameters


getFormParameterMax

public int getFormParameterMax()

addMimeMapping

@Configurable
public void addMimeMapping(MimeMapping mimeMapping)
Adds a mime-mapping


putLocaleEncoding

public void putLocaleEncoding(java.lang.String locale,
                              java.lang.String encoding)
Adds a locale-mapping


getLocaleEncoding

public java.lang.String getLocaleEncoding(java.util.Locale locale)
Returns the locale encoding.


setLoginConfig

public void setLoginConfig(LoginConfig loginConfig)
Sets the login


setLogin

public void setLogin(Login login)
Sets the login


getRoleMapManager

public RoleMapManager getRoleMapManager()
Returns the RoleMapManager


add

public void add(RewriteFilter filter)
Adds a rewrite dispatch rule


add

public void add(DispatchRule rule)
Adds a rewrite dispatch rule


createRewriteDispatch

public RewriteDispatch createRewriteDispatch()
Adds rewrite-dispatch (backwards compat).


addRewriteDispatch

public void addRewriteDispatch(RewriteDispatch dispatch)
Adds rewrite-dispatch.


createRewriteRealPath

public RewriteRealPath createRewriteRealPath()
Adds rewrite-real-path.


addPathMapping

public void addPathMapping(PathMapping pathMapping)
                    throws java.lang.Exception
Adds a path-mapping

Throws:
java.lang.Exception

addSecurityConstraint

public void addSecurityConstraint(SecurityConstraint constraint)
Adds a security constraint


add

public void add(SecurityConstraint constraint)

addSecurityRole

public void addSecurityRole(SecurityRole role)
Adds a security role


setSecure

@Configurable
public void setSecure(boolean isSecure)
Sets the secure requirement.


isSecure

public boolean isSecure()

isRequestSecure

public java.lang.Boolean isRequestSecure()

createListener

public <T extends java.util.EventListener> T createListener(java.lang.Class<T> listenerClass)
                                                 throws ServletException
Specified by:
createListener in interface ServletContext
Overrides:
createListener in class ServletContextImpl
Throws:
ServletException

addListener

public void addListener(java.lang.String className)
Specified by:
addListener in interface ServletContext
Overrides:
addListener in class ServletContextImpl

addListener

public void addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
Specified by:
addListener in interface ServletContext
Overrides:
addListener in class ServletContextImpl

addListener

public <T extends java.util.EventListener> void addListener(T listener)
Specified by:
addListener in interface ServletContext
Overrides:
addListener in class ServletContextImpl

addListener

@Configurable
public void addListener(ListenerConfig listener)
                 throws java.lang.Exception
Overrides:
addListener in class ServletContextImpl
Throws:
java.lang.Exception

hasListener

public boolean hasListener(java.lang.Class<?> listenerClass)
Returns true if a listener with the given type exists.


getRequestListeners

public ServletRequestListener[] getRequestListeners()
Returns the request listeners.


getRequestAttributeListeners

public ServletRequestAttributeListener[] getRequestAttributeListeners()
Returns the request attribute listeners.


addResourceRef

public void addResourceRef(ResourceRef ref)
Adds a ResourceRef validator.


createMultipartForm

@Configurable
public MultipartForm createMultipartForm()
Multipart form config.


isMultipartFormEnabled

public boolean isMultipartFormEnabled()
Returns true if multipart forms are enabled.


getFormUploadMax

public long getFormUploadMax()
Returns the form upload max.


getFormParameterLengthMax

public long getFormParameterLengthMax()
Returns the form upload max.


getAccessLog

public AbstractAccessLog getAccessLog()
Returns the access log


setTempDir

public void setTempDir(Path path)
Sets the temporary directory


createJsp

@Configurable
public JspPropertyGroup createJsp()
jsp configuration


getJsp

public JspPropertyGroup getJsp()
Returns the JSP configuration.


createJsf

public JsfPropertyGroup createJsf()
jsf configuration


getJsf

@Configurable
public JsfPropertyGroup getJsf()
Returns the JSF configuration


isFacesServletConfigured

public boolean isFacesServletConfigured()

getJspApplicationContext

public JspApplicationContextImpl getJspApplicationContext()
Returns the JspApplicationContext for EL evaluation.


hasPre23Config

public boolean hasPre23Config()
Returns true for JSP 1.x


addTaglib

@Configurable
public void addTaglib(JspTaglib taglib)
taglib configuration


getTaglibList

public java.util.ArrayList<JspTaglib> getTaglibList()
Returns the taglib configuration.


getTaglibs

public java.util.Collection<TaglibDescriptor> getTaglibs()
Specified by:
getTaglibs in interface JspConfigDescriptor

getJspPropertyGroups

public java.util.Collection<JspPropertyGroupDescriptor> getJspPropertyGroups()
Specified by:
getJspPropertyGroups in interface JspConfigDescriptor

createJspConfig

public JspConfig createJspConfig()

addJspConfig

public void addJspConfig(JspConfig config)
jsp-config configuration


getJspConfigDescriptor

public JspConfigDescriptor getJspConfigDescriptor()
Specified by:
getJspConfigDescriptor in interface ServletContext
Overrides:
getJspConfigDescriptor in class ServletContextImpl

getExtension

public java.lang.Object getExtension(java.lang.String key)
Returns an extension.


createEjbRef

public EjbRef createEjbRef()
ejb-ref configuration


createEjbLocalRef

public EjbLocalRef createEjbLocalRef()
ejb-local-ref configuration


createWebAppDeploy

public WebAppExpandDeployGenerator createWebAppDeploy()
Sets the war-expansion


addWebAppDeploy

@Configurable
public void addWebAppDeploy(WebAppExpandDeployGenerator deploy)
                     throws java.lang.Exception
Adds a war generator

Throws:
java.lang.Exception

addWebAppDefault

@Configurable
public void addWebAppDefault(WebAppConfig config)
Adds a web-app default


getWebAppDefaultList

public java.util.ArrayList<WebAppConfig> getWebAppDefaultList()
Adds a web-app default


addWebApp

@Configurable
public void addWebApp(WebAppConfig config)
               throws java.lang.Exception
Adds a sub web-app

Throws:
java.lang.Exception

setConfigException

public void setConfigException(java.lang.Throwable e)
Sets the config exception.

Specified by:
setConfigException in interface DeployInstance

getConfigException

public java.lang.Throwable getConfigException()
Gets the config exception.

Specified by:
getConfigException in interface DeployInstance

isIgnoreClientDisconnect

public boolean isIgnoreClientDisconnect()
Returns true if should ignore client disconnect.


setShutdownWaitMax

@Configurable
public void setShutdownWaitMax(Period wait)
Sets the delay time waiting for requests to end.


setActiveWaitTime

@Configurable
public void setActiveWaitTime(Period wait)
Sets the delay time waiting for a restart


setIdleTime

@Configurable
public void setIdleTime(Period idle)
Sets the delay time waiting for requests to end.


addConfigFile

public void addConfigFile(Path path)
                   throws java.lang.Exception
Backwards compatability for config-file.

Throws:
java.lang.Exception

getState

public java.lang.String getState()
Returns true if the webApp is active.


isInit

public boolean isInit()
Returns true if it's init.


isInitializing

public boolean isInitializing()
Returns true if it's in the middle of initializing


isActive

public boolean isActive()
Returns true if the webApp is active.

Overrides:
isActive in class ServletContextImpl

isClosed

public boolean isClosed()
Returns true if it's closed.


getThreadRequest

public static ServletRequest getThreadRequest()

init

@PostConstruct
public void init()
          throws java.lang.Exception
Initializes.

Specified by:
init in interface EnvironmentDeployInstance
Throws:
java.lang.Exception

initWebFragments

public void initWebFragments()

isApplyingWebFragments

public boolean isApplyingWebFragments()

isAllowInitParamOverride

public boolean isAllowInitParamOverride()

initAnnotated

public void initAnnotated()
                   throws java.lang.Exception
Throws:
java.lang.Exception

getAdmin

public WebAppAdmin getAdmin()

start

public void start()
Description copied from interface: DeployInstance
Starts the deployment instance

Specified by:
start in interface DeployInstance

isModified

public boolean isModified()
Returns true if the webApp has been modified.

Specified by:
isModified in interface DeployInstance
Specified by:
isModified in interface Dependency

isModifiedNow

public boolean isModifiedNow()
Returns true if the webApp has been modified.

Specified by:
isModifiedNow in interface DeployInstance

logModified

public boolean logModified(java.util.logging.Logger log)
Log the reason for modification.

Specified by:
logModified in interface DeployInstance
Specified by:
logModified in interface Dependency

isDeployError

public boolean isDeployError()
Returns true if the webApp deployed with an error.


isDeployIdle

public boolean isDeployIdle()
Returns true if the deployment is idle.

Specified by:
isDeployIdle in interface DeployInstance

getContext

public ServletContext getContext(java.lang.String uri)
Returns the servlet context for the URI.

Specified by:
getContext in interface ServletContext
Overrides:
getContext in class ServletContextImpl
Parameters:
uri - path relative to the root
Returns:
the ServletContext responsible for the given uri.

getServletPattern

public java.lang.String getServletPattern(java.lang.String uri)
Returns the best matching servlet pattern.


getServletMappingPatterns

public java.util.ArrayList<java.lang.String> getServletMappingPatterns()
Returns the best matching servlet pattern.


getServletIgnoreMappingPatterns

public java.util.ArrayList<java.lang.String> getServletIgnoreMappingPatterns()
Returns the best matching servlet pattern.


buildInvocation

public Invocation buildInvocation(Invocation invocation)
Fills the servlet instance. (Generalize?)

Specified by:
buildInvocation in interface InvocationBuilder

getServletMapper

public ServletMapper getServletMapper()

clearCache

public void clearCache()
Clears all caches, including the invocation cache, the filter cache, and the proxy cache.


buildIncludeInvocation

public void buildIncludeInvocation(Invocation invocation)
                            throws ServletException
Fills the invocation for an include request.

Throws:
ServletException

buildForwardInvocation

public void buildForwardInvocation(Invocation invocation)
                            throws ServletException
Fills the invocation for a forward request.

Throws:
ServletException

buildErrorInvocation

public void buildErrorInvocation(Invocation invocation)
                          throws ServletException
Fills the invocation for an error request.

Throws:
ServletException

buildLoginInvocation

public void buildLoginInvocation(Invocation invocation)
                          throws ServletException
Fills the invocation for a login request.

Throws:
ServletException

buildDispatchInvocation

public void buildDispatchInvocation(Invocation invocation)
                             throws ServletException
Fills the invocation for a rewrite-dispatch/dispatch request.

Throws:
ServletException

buildDispatchInvocation

public void buildDispatchInvocation(Invocation invocation,
                                    FilterMapper filterMapper)
                             throws ServletException
Fills the invocation for subrequests.

Throws:
ServletException

getRequestDispatcher

public RequestDispatcherImpl getRequestDispatcher(java.lang.String url)
Returns a dispatcher for the named servlet.

Specified by:
getRequestDispatcher in interface ServletContext
Overrides:
getRequestDispatcher in class ServletContextImpl
Parameters:
url - path relative to the app root (including query string) for the included file.
Returns:
RequestDispatcher for later inclusion or forwarding.

accessLog

public void accessLog(HttpServletRequest req,
                      HttpServletResponse res)
               throws java.io.IOException
Access logging for high-level errors

Throws:
java.io.IOException

getLoginDispatcher

public RequestDispatcher getLoginDispatcher(java.lang.String url)
Returns a dispatcher for the named servlet.


getNamedDispatcher

public RequestDispatcher getNamedDispatcher(java.lang.String servletName)
Returns a dispatcher for the named servlet.

Specified by:
getNamedDispatcher in interface ServletContext
Overrides:
getNamedDispatcher in class ServletContextImpl
Parameters:
servletName - the servlet name to include or forward to.
Returns:
RequestDispatcher for later inclusion or forwarding.

getRealPath

public java.lang.String getRealPath(java.lang.String uri)
Maps from a URI to a real path.

Specified by:
getRealPath in interface ServletContext
Overrides:
getRealPath in class ServletContextImpl
Parameters:
uri - path relative to the application root to be translated.
Returns:
native file path for the uri.

getRealPathImpl

public java.lang.String getRealPathImpl(java.lang.String uri)
Maps from a URI to a real path.


getMimeType

public java.lang.String getMimeType(java.lang.String uri)
Returns the mime type for a uri

Specified by:
getMimeType in interface ServletContext
Overrides:
getMimeType in class ServletContextImpl
Parameters:
uri - path relative to the application root.

getMimeTypeImpl

public java.lang.String getMimeTypeImpl(java.lang.String ext)
Maps from a URI to a real path.


log

public void log(java.lang.String message,
                java.lang.Throwable e)
Error logging

Specified by:
log in interface ServletContext
Overrides:
log in class ServletContextImpl
Parameters:
message - message to log
e - stack trace of the error

getLogin

public Login getLogin()
Gets the login manager.


getConfiguredLogin

public Login getConfiguredLogin()

getAuthenticator

public Authenticator getAuthenticator()
Gets the authenticator


getConfiguredAuthenticator

public Authenticator getConfiguredAuthenticator()
Gets the authenticator


getSessionCookieConfig

public SessionCookieConfig getSessionCookieConfig()
Description copied from class: ServletContextCompat
Sets the session cookie configuration

Specified by:
getSessionCookieConfig in interface ServletContext
Overrides:
getSessionCookieConfig in class ServletContextCompat

getSessionManager

public SessionManager getSessionManager()
Gets the session manager.


getErrorPageManager

public ErrorPageManager getErrorPageManager()
Gets the error page manager.


getRequestCount

public int getRequestCount()
Returns the request count.


addCacheMapping

public void addCacheMapping(CacheMapping mapping)
                     throws java.lang.Exception
Returns the maximum length for a cache.

Throws:
java.lang.Exception

getMaxAge

public long getMaxAge(java.lang.String uri)
Returns the time for a cache mapping.


getSMaxAge

public long getSMaxAge(java.lang.String uri)
Returns the time for a cache mapping.


getCacheMaxLength

public long getCacheMaxLength()
Returns the maximum length for a cache.


getClassLoaderHackPackages

public java.lang.String[] getClassLoaderHackPackages()
Returns the classloader hack packages.


getActiveSessionCount

public int getActiveSessionCount()
Returns the active session count.


generateCookieDomain

public java.lang.String generateCookieDomain(HttpServletRequest request)

runInSessionContext

public void runInSessionContext(java.lang.String sessionId,
                                java.lang.Runnable task)
Runs a thread in a session context


stop

public void stop()
Stops the webApp.


destroy

public void destroy()
Closes the webApp.

Specified by:
destroy in interface DeployInstance

addStatus500

public void addStatus500()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object