public class WebApplicationContext extends ServletHttpContext implements Externalizable
WebApplicationHandler,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static interface |
WebApplicationContext.Configuration
Base Class for WebApplicationContext Configuration.
|
__ErrorHandler, __fileClassPathAttr| Constructor and Description |
|---|
WebApplicationContext()
Constructor.
|
WebApplicationContext(String webApp)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(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.
|
String[] |
getConfigurationClassNames() |
WebApplicationContext.Configuration[] |
getConfigurations() |
String |
getDefaultsDescriptor() |
String |
getDisplayName() |
String |
getErrorPage(String error)
get error page URI.
|
boolean |
getExtractWAR() |
Resource |
getResource(String uriInContext) |
String |
getResourceAlias(String alias) |
Map |
getResourceAliases() |
ServletHandler |
getServletHandler()
Get the context ServletHandler.
|
protected UserRealm |
getUserRealm(String name) |
String |
getWAR() |
WebApplicationHandler |
getWebApplicationHandler() |
Resource |
getWebInf() |
void |
handle(String pathInContext,
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(ObjectInput in) |
String |
removeErrorPage(String error) |
void |
removeEventListener(EventListener listener) |
String |
removeResourceAlias(String alias) |
void |
setConfigurationClassNames(String[] configurationClassNames) |
void |
setDefaultsDescriptor(String defaults)
Set the defaults web.xml file.
|
void |
setDisplayName(String name) |
void |
setDistributable(boolean distributable) |
void |
setErrorPage(String error,
String uriInContext)
set error page URI.
|
void |
setExtractWAR(boolean extract) |
void |
setIgnoreWebJetty(boolean b) |
void |
setPermissions(PermissionCollection permissions)
Set the permissions to be used for this context.
|
void |
setResourceAlias(String alias,
String uri)
Set Resource Alias.
|
void |
setWAR(String war) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
addLocaleEncoding, addServlet, addServlet, checkSecurityConstraints, enterContextScope, getLocaleEncoding, getServletContext, jSecurityCheck, sendErroraddClassPath, 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, toStringaddComponent, getComponents, isStarted, isStarting, isStopping, removeComponent, start, stoppublic WebApplicationContext()
public WebApplicationContext(String webApp)
webApp - The Web application directory or WAR file.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void setConfigurationClassNames(String[] configurationClassNames)
public String[] getConfigurationClassNames()
public void setWAR(String war)
war - Filename or URL of the web application directory or WAR file.public String getWAR()
public WebApplicationHandler getWebApplicationHandler()
public Resource getWebInf() throws IOException
IOExceptionpublic ServletHandler getServletHandler()
getServletHandler in class ServletHttpContextpublic void setPermissions(PermissionCollection permissions)
HttpContextsetPermissions in class HttpContextpublic 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 Exception
Exceptionprotected void doStart()
throws Exception
doStart in class HttpContextIOExceptionExceptionprotected void doStop()
throws Exception
doStop in class ServletHttpContextInterruptedExceptionExceptionpublic void destroy()
HttpContextdestroy in class ServletHttpContextpublic void handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse httpResponse) throws HttpException, IOException
HttpContexthandle in interface HttpHandlerhandle in class HttpContextpathInContext - Path in contextpathParams - Path parameters such as encoded Session IDhttpRequest - The HttpRequest requesthttpResponse - The HttpResponse responseHttpExceptionIOExceptionpublic void addEventListener(EventListener listener) throws IllegalArgumentException
ContaineraddEventListener in interface EventProvideraddEventListener in class Containerlistener - ComponentEventListener or LifeCycleEventListenerIllegalArgumentException - If the EventListener type is not supported.public void removeEventListener(EventListener listener)
removeEventListener in interface EventProviderremoveEventListener in class Containerpublic String getDisplayName()
public void setDisplayName(String name)
public void setDefaultsDescriptor(String defaults)
defaults - File, Resource, URL or null.public 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 Exception
Exception - if an error occurspublic String toString()
toString in class ServletHttpContextpublic void setResourceAlias(String alias, String uri)
alias - uri - public Map getResourceAliases()
public Resource getResource(String uriInContext) throws IOException
getResource in class HttpContextIOExceptionpublic void setErrorPage(String error, String uriInContext)
error - A string representing an error code or a
exception classnameuriInContext - public String getErrorPage(String error)
error - A string representing an error code or a
exception classnameCopyright © 2015. All Rights Reserved.