| Modifier and Type | Field and Description |
|---|---|
protected StandardHost |
host
The
StandardHost instance we are associated with. |
INSTALL_EVENT, PRE_INSTALL_EVENT, REMOVE_EVENT| Constructor and Description |
|---|
StandardHostDeployer() |
StandardHostDeployer(StandardHost host)
Create a new StandardHostDeployer associated with the specified
StandardHost.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Container child)
Delegate a request to add a child Context to our associated Host.
|
protected Digester |
createDigester()
Create (if necessary) and return a Digester configured to process the
context configuration descriptor for an application.
|
protected void |
deleteDir(File dir)
Delete the specified directory, including all of its contents and
subdirectories recursively.
|
protected void |
deleteFile(File dir) |
Context |
findDeployedApp(String contextPath)
Return the Context for the deployed application that is associated
with the specified context path (if any); otherwise return
null. |
String[] |
findDeployedApps()
Return the context paths of all deployed web applications in this
Container.
|
Host |
getHost() |
String |
getName()
Return the name of the Container with which this Deployer is associated.
|
ClassLoader |
getParentClassLoader()
Delegate a request for the parent class loader to our associated Host.
|
void |
install(String contextPath,
URL war)
Install a new web application, whose web application archive is at the
specified URL, into this container with the specified context path.
|
void |
install(String contextPath,
URL war,
String configFile)
Install a new web application, whose web application archive is at the
specified URL, into this container with the specified context path.
|
void |
install(URL config,
URL war)
Install a new web application, whose context configuration file
(consisting of a
<Context> element) and (optional)
web application archive are at the specified URLs. |
void |
remove(String contextPath)
Remove an existing web application, attached to the specified context
path.
|
void |
remove(String contextPath,
boolean undeploy)
Remove an existing web application, attached to the specified context
path.
|
void |
setHost(Host host) |
void |
start(String contextPath)
Start an existing web application, attached to the specified context
path.
|
void |
stop(String contextPath)
Stop an existing web application, attached to the specified context
path.
|
protected StandardHost host
StandardHost instance we are associated with.public StandardHostDeployer()
public StandardHostDeployer(StandardHost host)
host - The StandardHost we are associated withpublic Host getHost()
public void setHost(Host host)
public String getName()
public void install(String contextPath, URL war) throws IOException
If this application is successfully installed, a ContainerEvent of type
PRE_INSTALL_EVENT will be sent to registered listeners
before the associated Context is started, and a ContainerEvent of type
INSTALL_EVENT will be sent to all registered listeners
after the associated Context is started, with the newly created
Context as an argument.
install in interface DeployercontextPath - The context path to which this application should
be installed (must be unique)war - A URL of type "jar:" that points to a WAR file, or type
"file:" that points to an unpacked directory structure containing
the web application to be installedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalStateException - if the specified context path
is already attached to an existing web applicationIOException - if an input/output error was encountered
during installationpublic void install(String contextPath, URL war, String configFile) throws IOException
If this application is successfully installed, a ContainerEvent of type
PRE_INSTALL_EVENT will be sent to registered listeners
before the associated Context is started, and a ContainerEvent of type
INSTALL_EVENT will be sent to all registered listeners
after the associated Context is started, with the newly created
Context as an argument.
contextPath - The context path to which this application should
be installed (must be unique)war - A URL of type "jar:" that points to a WAR file, or type
"file:" that points to an unpacked directory structure containing
the web application to be installedconfigFile - The path to a file to save the Context information.
If configFile is null, the Context information is saved in server.xml;
if it is NOT null, the Context information is saved in configFile.IllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalStateException - if the specified context path
is already attached to an existing web applicationIOException - if an input/output error was encountered
during installationpublic void install(URL config, URL war) throws IOException
Install a new web application, whose context configuration file
(consisting of a <Context> element) and (optional)
web application archive are at the specified URLs.
PRE_INSTALL_EVENT will be sent to registered listeners
before the associated Context is started, and a ContainerEvent of type
INSTALL_EVENT will be sent to all registered listeners
after the associated Context is started, with the newly created
Context as an argument.install in interface Deployerconfig - A URL that points to the context configuration descriptor
to be used for configuring the new Contextwar - A URL of type "jar:" that points to a WAR file, or type
"file:" that points to an unpacked directory structure containing
the web application to be installed, or null to use
the docBase attribute from the configuration descriptorIllegalArgumentException - if one of the specified URLs is
nullIllegalStateException - if the context path specified in the
context configuration file is already attached to an existing web
applicationIOException - if an input/output error was encountered
during installationpublic Context findDeployedApp(String contextPath)
null.findDeployedApp in interface DeployercontextPath - The context path of the requested web applicationpublic String[] findDeployedApps()
findDeployedApps in interface Deployerpublic void remove(String contextPath) throws IOException
REMOVE_EVENT will be sent to all
registered listeners, with the removed Context as
an argument.remove in interface DeployercontextPath - The context path of the application to be removedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs during
removalpublic void remove(String contextPath, boolean undeploy) throws IOException
REMOVE_EVENT will be sent to all
registered listeners, with the removed Context as
an argument. Deletes the web application war file and/or directory
if they exist in the Host's appBase.remove in interface DeployercontextPath - The context path of the application to be removedundeploy - boolean flag to remove web application from serverIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs during
removalpublic void start(String contextPath) throws IOException
start in interface DeployercontextPath - The context path of the application to be startedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs during
startuppublic void stop(String contextPath) throws IOException
stop in interface DeployercontextPath - The context path of the application to be stoppedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs while stopping
the web applicationpublic void addChild(Container child)
child - The child Context to be addedpublic ClassLoader getParentClassLoader()
protected Digester createDigester()
protected void deleteDir(File dir)
dir - File object representing the directory to be deletedprotected void deleteFile(File dir)
Copyright © 2017. All rights reserved.