public interface Deployer
Modifier and Type | Field and Description |
---|---|
static String |
INSTALL_EVENT
The ContainerEvent event type sent when a new application is
installed by
install() , after it has been started. |
static String |
PRE_INSTALL_EVENT
The ContainerEvent event type sent when a new application is
being installed by
install() , before it has been
started. |
static String |
REMOVE_EVENT
The ContainerEvent event type sent when an existing application is
removed by
remove() . |
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getName()
Return the name of the Container with which this Deployer is associated.
|
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(URL config,
URL war)
Install a new web application, whose context configuration file
(consisting of a
<Context> element) and 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 |
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.
|
static final String PRE_INSTALL_EVENT
install()
, before it has been
started.static final String INSTALL_EVENT
install()
, after it has been started.static final String REMOVE_EVENT
remove()
.String getName()
void install(String contextPath, URL war) throws IOException
If this application is successfully installed, a ContainerEvent of type
INSTALL_EVENT
will be sent to all registered listeners,
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 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 installationvoid install(URL config, URL war) throws IOException
Install a new web application, whose context configuration file
(consisting of a <Context>
element) and web
application archive are at the specified URLs.
If this application is successfully installed, a ContainerEvent
of type INSTALL_EVENT
will be sent to all registered
listeners, with the newly created Context
as an argument.
config
- A URL that points to the context configuration file 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 installedIllegalArgumentException
- 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 installationContext findDeployedApp(String contextPath)
null
.contextPath
- The context path of the requested web applicationString[] findDeployedApps()
void remove(String contextPath) throws IOException
REMOVE_EVENT
will be sent to all
registered listeners, with the removed Context
as
an argument.contextPath
- 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
removalvoid 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.contextPath
- 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
removalvoid start(String contextPath) throws IOException
contextPath
- 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
startupvoid stop(String contextPath) throws IOException
contextPath
- 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 applicationCopyright © 2019. All rights reserved.