public class WebApplicationContext extends ServletHttpContext implements 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(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, 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, isStarted, isStarting, isStopping, removeComponent, start, stop
public WebApplicationContext()
public WebApplicationContext(String webApp)
webApp
- The Web application directory or WAR file.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public 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
IOException
public ServletHandler getServletHandler()
getServletHandler
in class ServletHttpContext
public void setPermissions(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 Exception
Exception
protected void doStart() throws Exception
doStart
in class HttpContext
IOException
Exception
protected void doStop() throws Exception
doStop
in class ServletHttpContext
InterruptedException
Exception
public void destroy()
HttpContext
destroy
in class ServletHttpContext
public void handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse httpResponse) throws HttpException, 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
IOException
public void addEventListener(EventListener listener) throws IllegalArgumentException
Container
addEventListener
in interface EventProvider
addEventListener
in class Container
listener
- ComponentEventListener or LifeCycleEventListenerIllegalArgumentException
- If the EventListener type is not supported.public void removeEventListener(EventListener listener)
removeEventListener
in interface EventProvider
removeEventListener
in class Container
public 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 ServletHttpContext
public void setResourceAlias(String alias, String uri)
alias
- uri
- public Map getResourceAliases()
public Resource getResource(String uriInContext) throws IOException
getResource
in class HttpContext
IOException
public 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 © 2016. All Rights Reserved.