public class WebAppContainer extends java.lang.Object implements InvocationBuilder, ClassLoaderListener, EnvironmentListener
Constructor and Description |
---|
WebAppContainer(ServletService server,
Host host,
Path rootDirectory,
EnvironmentClassLoader loader,
Lifecycle lifecycle)
Creates the webApp with its environment loader.
|
Modifier and Type | Method and Description |
---|---|
void |
add(DispatchRule dispatchRule)
Adds a rewrite dispatch rule
|
void |
add(RewriteFilter dispatchAction)
Adds a rewrite dispatch rule
|
void |
addApplication(EarConfig config)
Adds an enterprise webApp.
|
void |
addDeploy(DeployGenerator<WebAppController> deploy)
Sets the war-expansion
|
void |
addEarDefault(EarConfig config)
Adds an ear default
|
void |
addEarDeploy(EarDeployGenerator earDeploy)
Adds the ear-expansion
|
void |
addErrorPage(ErrorPage errorPage)
Adds an error page
|
void |
addWarDeploy(WebAppExpandDeployGenerator webAppDeploy)
Sets the war-expansion
|
void |
addWebApp(WebAppConfig config)
Adds an webApp.
|
void |
addWebApp(WebAppSingleDeployGenerator deployGenerator) |
void |
addWebAppDefault(WebAppConfig init)
Adds a web-app default
|
void |
addWebAppDeploy(WebAppExpandDeployGenerator deploy)
Sets the war-expansion
|
void |
buildDispatchInvocation(Invocation invocation)
Creates the invocation for a rewrite-dispatch/dispatch.
|
void |
buildErrorInvocation(Invocation invocation)
Creates the error invocation.
|
void |
buildForwardInvocation(Invocation invocation)
Creates the invocation.
|
void |
buildIncludeInvocation(Invocation invocation)
Creates the invocation.
|
Invocation |
buildInvocation(Invocation invocation)
Creates the invocation.
|
void |
buildLoginInvocation(Invocation invocation)
Creates the invocation.
|
void |
classLoaderDestroy(DynamicClassLoader loader)
Handles the case where a class loader is dropped.
|
void |
classLoaderInit(DynamicClassLoader loader)
Handles the case where a class loader has completed initialization
|
void |
clearCache()
Clears the cache
|
AbstractAccessLog |
createAccessLog()
Sets the access log.
|
WebAppSingleDeployGenerator |
createDeployGenerator(WebAppConfig config) |
EarDeployGenerator |
createEarDeploy()
Sets the ear-expansion
|
RewriteDispatch |
createRewriteDispatch()
Adds rewrite-dispatch (backward compat).
|
WebAppExpandDeployGenerator |
createWarDeploy()
Sets the war-expansion
|
WebAppExpandDeployGenerator |
createWebAppDeploy()
Sets the war-expansion
|
void |
destroy()
Closes the container.
|
void |
environmentBind(EnvironmentClassLoader loader)
Handles the environment bind phase
|
void |
environmentConfigure(EnvironmentClassLoader loader)
Handles the environment config phase
|
void |
environmentStart(EnvironmentClassLoader loader)
Handles the case where the environment is starting (after init).
|
void |
environmentStop(EnvironmentClassLoader loader)
Handles the case where the environment is stopping
|
void |
expandEarDeploy(java.lang.String name)
Updates an ear deploy
|
WebAppController |
findByURI(java.lang.String uri)
Finds the web-app matching the current entry.
|
WebAppController |
findController(java.lang.String subURI)
Finds the web-app for the entry, not checking for sub-apps.
|
com.caucho.server.webapp.WebAppContainer.WebAppUriMap |
findEntryByURI(java.lang.String uri)
Finds the web-app matching the current entry.
|
WebApp |
findSubWebAppByURI(java.lang.String uri)
Creates the invocation.
|
WebApp |
findWebAppByURI(java.lang.String uri)
Creates the invocation.
|
java.lang.ClassLoader |
getClassLoader()
Gets the class loader.
|
Path |
getDocumentDirectory()
Gets the document directory.
|
java.util.ArrayList<EarConfig> |
getEarDefaultList()
Returns the list of ear defaults
|
DeployContainerApi<EarDeployController> |
getEarDeployContainer() |
EarDeployController[] |
getEntAppList()
Returns a list of the webApps.
|
ErrorPageManager |
getErrorPageManager()
Returns the error page manager
|
WebApp |
getErrorWebApp()
Returns the error webApp during startup.
|
Host |
getHost()
Returns the owning host.
|
java.lang.String |
getHostName()
Returns the host name for the container.
|
java.lang.String |
getId()
Returns the URL for the container.
|
InvocationDecoder |
getInvocationDecoder() |
RequestDispatcher |
getRequestDispatcher(java.lang.String url)
Returns a dispatcher for the named servlet.
|
Path |
getRootDirectory()
Gets the root directory.
|
protected ServletService |
getServer() |
SessionManager |
getSessionManager()
Returns the container's session manager.
|
java.lang.String |
getStageTag() |
java.lang.String |
getURL()
Returns the URL for the container.
|
Path |
getWarDir()
Gets the war-dir.
|
Path |
getWarExpandDir()
Gets the war-expand-dir.
|
protected WebAppController |
getWebAppController(Invocation invocation)
Returns the webApp controller for the current request.
|
java.util.ArrayList<WebAppConfig> |
getWebAppDefaultList()
Returns the list of web-app defaults
|
DeployContainerApi<WebAppController> |
getWebAppDeployContainer() |
DeployContainer<WebAppController> |
getWebAppGenerator()
Returns the webApp generator
|
WebAppController[] |
getWebAppList()
Returns a list of the webApps.
|
boolean |
isActive()
Returns true if the webApp container is active
|
boolean |
isDeployModified()
For QA, returns true if the deployment is marked as modified.
|
boolean |
isDestroyed()
Returns true if the webApp container has been closed.
|
boolean |
isModified()
Returns true if modified.
|
void |
removeWebApp(WebAppSingleDeployGenerator deployGenerator) |
void |
removeWebAppDeploy(DeployGenerator<WebAppController> deploy)
Removes a web-app-generator.
|
void |
setAccessLog(AbstractAccessLog log)
Sets the access log.
|
void |
setConfigException(java.lang.Throwable e)
Sets a configuration exception.
|
void |
setDocDir(Path path)
Sets the document directory.
|
void |
setDocumentDirectory(Path path)
Sets the document directory.
|
void |
setEnvironmentClassLoader(EnvironmentClassLoader loader)
sets the class loader.
|
void |
setRootDirectory(Path path)
Sets the root directory.
|
void |
setWarDir(Path warDir)
Sets the war-dir for backwards compatibility.
|
void |
setWarExpandDir(Path warDir)
Sets the war-expand-dir.
|
void |
start()
Starts the container.
|
void |
startEarDeploy(java.lang.String name)
Start an ear
|
boolean |
stop()
Closes the container.
|
java.lang.String |
toString() |
void |
updateEarDeploy(java.lang.String name)
Updates an ear deploy
|
void |
updateWebAppDeploy(java.lang.String name)
Updates a WebApp deploy
|
public WebAppContainer(ServletService server, Host host, Path rootDirectory, EnvironmentClassLoader loader, Lifecycle lifecycle)
protected ServletService getServer()
public InvocationDecoder getInvocationDecoder()
public java.lang.ClassLoader getClassLoader()
public void setEnvironmentClassLoader(EnvironmentClassLoader loader)
public Host getHost()
public java.lang.String getStageTag()
public Path getRootDirectory()
public void setRootDirectory(Path path)
public Path getDocumentDirectory()
public void setDocumentDirectory(Path path)
public void setDocDir(Path path)
public AbstractAccessLog createAccessLog()
public void setAccessLog(AbstractAccessLog log)
public void addErrorPage(ErrorPage errorPage)
public ErrorPageManager getErrorPageManager()
public void setConfigException(java.lang.Throwable e)
public DeployContainer<WebAppController> getWebAppGenerator()
public SessionManager getSessionManager()
public void add(DispatchRule dispatchRule)
public void add(RewriteFilter dispatchAction)
public RewriteDispatch createRewriteDispatch()
public boolean isModified()
public boolean isDeployModified()
public void addWebApp(WebAppConfig config)
public WebAppSingleDeployGenerator createDeployGenerator(WebAppConfig config)
public void addWebApp(WebAppSingleDeployGenerator deployGenerator)
public void removeWebApp(WebAppSingleDeployGenerator deployGenerator)
public void addWebAppDefault(WebAppConfig init)
public java.util.ArrayList<WebAppConfig> getWebAppDefaultList()
public WebAppExpandDeployGenerator createWarDeploy()
public WebAppExpandDeployGenerator createWebAppDeploy()
public void addWebAppDeploy(WebAppExpandDeployGenerator deploy) throws ConfigException
ConfigException
public void addWarDeploy(WebAppExpandDeployGenerator webAppDeploy) throws ConfigException
ConfigException
public void addDeploy(DeployGenerator<WebAppController> deploy) throws ConfigException
ConfigException
public void removeWebAppDeploy(DeployGenerator<WebAppController> deploy)
public void updateWebAppDeploy(java.lang.String name) throws java.lang.Throwable
java.lang.Throwable
public void addApplication(EarConfig config)
public void updateEarDeploy(java.lang.String name) throws java.lang.Throwable
java.lang.Throwable
public void expandEarDeploy(java.lang.String name)
public void startEarDeploy(java.lang.String name)
public void addEarDefault(EarConfig config)
public java.util.ArrayList<EarConfig> getEarDefaultList()
public EarDeployGenerator createEarDeploy() throws java.lang.Exception
java.lang.Exception
public void addEarDeploy(EarDeployGenerator earDeploy) throws java.lang.Exception
java.lang.Exception
public java.lang.String getURL()
public java.lang.String getId()
public java.lang.String getHostName()
public void setWarDir(Path warDir) throws ConfigException
ConfigException
public Path getWarDir()
public void setWarExpandDir(Path warDir)
public Path getWarExpandDir()
public void start()
public void clearCache()
public Invocation buildInvocation(Invocation invocation) throws ConfigException
buildInvocation
in interface InvocationBuilder
ConfigException
public RequestDispatcher getRequestDispatcher(java.lang.String url)
public void buildIncludeInvocation(Invocation invocation) throws ServletException
ServletException
public void buildForwardInvocation(Invocation invocation) throws ServletException
ServletException
public void buildErrorInvocation(Invocation invocation) throws ServletException
ServletException
public void buildLoginInvocation(Invocation invocation) throws ServletException
ServletException
public void buildDispatchInvocation(Invocation invocation) throws ServletException
ServletException
protected WebAppController getWebAppController(Invocation invocation)
invocation
- the request's invocationpublic WebApp findWebAppByURI(java.lang.String uri)
public WebApp findSubWebAppByURI(java.lang.String uri)
public WebAppController findByURI(java.lang.String uri)
public com.caucho.server.webapp.WebAppContainer.WebAppUriMap findEntryByURI(java.lang.String uri)
public DeployContainerApi<WebAppController> getWebAppDeployContainer()
public WebAppController findController(java.lang.String subURI)
public WebAppController[] getWebAppList()
public DeployContainerApi<EarDeployController> getEarDeployContainer()
public EarDeployController[] getEntAppList()
public final boolean isDestroyed()
public final boolean isActive()
public boolean stop()
public void destroy()
public WebApp getErrorWebApp()
public void classLoaderInit(DynamicClassLoader loader)
classLoaderInit
in interface ClassLoaderListener
public void classLoaderDestroy(DynamicClassLoader loader)
classLoaderDestroy
in interface ClassLoaderListener
public void environmentConfigure(EnvironmentClassLoader loader)
environmentConfigure
in interface EnvironmentListener
public void environmentBind(EnvironmentClassLoader loader)
environmentBind
in interface EnvironmentListener
public void environmentStart(EnvironmentClassLoader loader)
environmentStart
in interface EnvironmentListener
public void environmentStop(EnvironmentClassLoader loader)
environmentStop
in interface EnvironmentListener
public java.lang.String toString()
toString
in class java.lang.Object