public class WebApplicationContext extends ServletHttpContext implements java.io.Externalizable
WebApplicationHandler
,
Serialized FormModifier and Type | Class and Description |
---|---|
static interface |
WebApplicationContext.Configuration
Base Class for WebApplicationContext Configuration.
|
__ErrorHandler, __fileClassPathAttr
Constructor and Description |
---|
WebApplicationContext()
Constructor.
|
WebApplicationContext(java.lang.String webApp)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(java.util.EventListener listener)
Add a server event listener.
|
protected void |
configureClassPath() |
protected void |
configureDefaults() |
protected void |
configureWebApp() |
void |
destroy()
Destroy a context.
|
protected void |
doStart()
Start the Web Application.
|
protected void |
doStop()
Stop the web application.
|
java.lang.String[] |
getConfigurationClassNames() |
WebApplicationContext.Configuration[] |
getConfigurations() |
java.lang.String |
getDefaultsDescriptor() |
java.lang.String |
getDisplayName() |
java.lang.String |
getErrorPage(java.lang.String error)
get error page URI.
|
boolean |
getExtractWAR() |
Resource |
getResource(java.lang.String uriInContext) |
java.lang.String |
getResourceAlias(java.lang.String alias) |
java.util.Map |
getResourceAliases() |
ServletHandler |
getServletHandler()
Get the context ServletHandler.
|
protected UserRealm |
getUserRealm(java.lang.String name) |
java.lang.String |
getWAR() |
WebApplicationHandler |
getWebApplicationHandler() |
Resource |
getWebInf() |
void |
handle(java.lang.String pathInContext,
java.lang.String pathParams,
HttpRequest httpRequest,
HttpResponse httpResponse)
Handler request.
|
protected void |
initialize()
Initialize is called by the start method after the contexts classloader
has been initialied, but before the defaults descriptor has been applied.
|
boolean |
isDistributable() |
boolean |
isIgnoreWebJetty() |
protected WebApplicationContext.Configuration[] |
loadConfigurations() |
void |
readExternal(java.io.ObjectInput in) |
java.lang.String |
removeErrorPage(java.lang.String error) |
void |
removeEventListener(java.util.EventListener listener) |
java.lang.String |
removeResourceAlias(java.lang.String alias) |
void |
setConfigurationClassNames(java.lang.String[] configurationClassNames) |
void |
setDefaultsDescriptor(java.lang.String defaults)
Set the defaults web.xml file.
|
void |
setDisplayName(java.lang.String name) |
void |
setDistributable(boolean distributable) |
void |
setErrorPage(java.lang.String error,
java.lang.String uriInContext)
set error page URI.
|
void |
setExtractWAR(boolean extract) |
void |
setIgnoreWebJetty(boolean b) |
void |
setPermissions(java.security.PermissionCollection permissions)
Set the permissions to be used for this context.
|
void |
setResourceAlias(java.lang.String alias,
java.lang.String uri)
Set Resource Alias.
|
void |
setWAR(java.lang.String war) |
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
addLocaleEncoding, addServlet, addServlet, checkSecurityConstraints, enterContextScope, getLocaleEncoding, getServletContext, jSecurityCheck, sendError
addClassPath, addClassPaths, addHandler, addHandler, addPermission, addSecurityConstraint, addVirtualHost, addWelcomeFile, canonicalContextPathSpec, clearSecurityConstraints, flushCache, getAttribute, getAttributeNames, getAttributes, getAuthenticator, getBaseResource, getClassLoader, getClassPath, getContextPath, getEncodingByMimeType, getEncodingMap, getFileClassPath, getHandler, getHandlerIndex, getHandlers, getHosts, getHttpConnection, getHttpContext, getHttpContextName, getHttpServer, getInitParameter, getInitParameterNames, getMaxCachedFileSize, getMaxCacheSize, getMimeByExtension, getMimeMap, getName, getParentClassLoader, getPermissions, getRealm, getRealmName, getRequestLog, getRequests, getRequestsActive, getRequestsActiveMax, getResourceBase, getResourceMetaData, getResponses1xx, getResponses2xx, getResponses3xx, getResponses4xx, getResponses5xx, getServerClasses, getStatsOn, getStatsOnMs, getStopGracefully, getSystemClasses, getTempDirectory, getVirtualHosts, getWelcomeFile, getWelcomeFiles, handle, initClassLoader, initialize, isClassLoaderJava2Compliant, isRedirectNullPath, leaveContextScope, loadClass, log, removeAttribute, removeHandler, removeHandler, removeVirtualHost, removeWelcomeFile, sendContextError, setAttribute, setAttributes, setAuthenticator, setBaseResource, setClassLoader, setClassLoaderJava2Compliant, setClassPath, setContextPath, setEncodingMap, setHandlers, setHosts, setHttpContextName, setInitParameter, setMaxCachedFileSize, setMaxCacheSize, setMimeMap, setMimeMapping, setParentClassLoader, setRealm, setRealmName, setRedirectNullPath, setRequestLog, setResourceBase, setServerClasses, setStatsOn, setStopGracefully, setSystemClasses, setTempDirectory, setTypeEncoding, setVirtualHosts, setWelcomeFiles, startHandlers, statsReset, stop, toString
addComponent, getComponents, isFailed, isStarted, isStarting, isStopping, removeComponent, start, stop
public WebApplicationContext()
public WebApplicationContext(java.lang.String webApp)
webApp
- The Web application directory or WAR file.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void setConfigurationClassNames(java.lang.String[] configurationClassNames)
public java.lang.String[] getConfigurationClassNames()
public void setWAR(java.lang.String war)
war
- Filename or URL of the web application directory or WAR file.public java.lang.String getWAR()
public WebApplicationHandler getWebApplicationHandler()
public Resource getWebInf() throws java.io.IOException
java.io.IOException
public ServletHandler getServletHandler()
getServletHandler
in class ServletHttpContext
public void setPermissions(java.security.PermissionCollection permissions)
HttpContext
setPermissions
in class HttpContext
public boolean isIgnoreWebJetty()
public void setIgnoreWebJetty(boolean b)
b
- If TRUE, web-jetty.xml and jetty-web.xml configuration
files are ignored.public boolean isDistributable()
public void setDistributable(boolean distributable)
public WebApplicationContext.Configuration[] getConfigurations()
protected WebApplicationContext.Configuration[] loadConfigurations() throws java.lang.Exception
java.lang.Exception
protected void configureClassPath() throws java.lang.Exception
java.lang.Exception
protected void configureDefaults() throws java.lang.Exception
java.lang.Exception
protected void configureWebApp() throws java.lang.Exception
java.lang.Exception
protected void doStart() throws java.lang.Exception
doStart
in class HttpContext
java.io.IOException
java.lang.Exception
protected void doStop() throws java.lang.Exception
doStop
in class ServletHttpContext
java.lang.InterruptedException
java.lang.Exception
public void destroy()
HttpContext
destroy
in class ServletHttpContext
public void handle(java.lang.String pathInContext, java.lang.String pathParams, HttpRequest httpRequest, HttpResponse httpResponse) throws HttpException, java.io.IOException
HttpContext
handle
in interface HttpHandler
handle
in class HttpContext
pathInContext
- Path in contextpathParams
- Path parameters such as encoded Session IDhttpRequest
- The HttpRequest requesthttpResponse
- The HttpResponse responseHttpException
java.io.IOException
public void addEventListener(java.util.EventListener listener) throws java.lang.IllegalArgumentException
Container
addEventListener
in interface EventProvider
addEventListener
in class Container
listener
- ComponentEventListener or LifeCycleEventListenerjava.lang.IllegalArgumentException
- If the EventListener type is not supported.public void removeEventListener(java.util.EventListener listener)
removeEventListener
in interface EventProvider
removeEventListener
in class Container
public java.lang.String getDisplayName()
public void setDisplayName(java.lang.String name)
public void setDefaultsDescriptor(java.lang.String defaults)
defaults
- File, Resource, URL or null.public java.lang.String getDefaultsDescriptor()
public void setExtractWAR(boolean extract)
extract
- If true, a WAR is extracted to a temporary
directory before being deployed.public boolean getExtractWAR()
protected void initialize() throws java.lang.Exception
java.lang.Exception
- if an error occursprotected UserRealm getUserRealm(java.lang.String name)
public java.lang.String toString()
toString
in class ServletHttpContext
public void setResourceAlias(java.lang.String alias, java.lang.String uri)
alias
- uri
- public java.util.Map getResourceAliases()
public java.lang.String getResourceAlias(java.lang.String alias)
public java.lang.String removeResourceAlias(java.lang.String alias)
public Resource getResource(java.lang.String uriInContext) throws java.io.IOException
getResource
in class HttpContext
java.io.IOException
public void setErrorPage(java.lang.String error, java.lang.String uriInContext)
error
- A string representing an error code or a
exception classnameuriInContext
- public java.lang.String getErrorPage(java.lang.String error)
error
- A string representing an error code or a
exception classnamepublic java.lang.String removeErrorPage(java.lang.String error)
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.