|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A Deployer is a specialized Container into which web applications can be deployed and undeployed. Such a Container will create and install child Context instances for each deployed application. The unique key for each web application will be the context path to which it is attached.
| Field Summary | |
static java.lang.String |
INSTALL_EVENT
The ContainerEvent event type sent when a new application is installed by install(), after it has been started. |
static java.lang.String |
PRE_INSTALL_EVENT
The ContainerEvent event type sent when a new application is being installed by install(), before it has been
started. |
static java.lang.String |
REMOVE_EVENT
The ContainerEvent event type sent when an existing application is removed by remove(). |
| Method Summary | |
Context |
findDeployedApp(java.lang.String contextPath)
Return the Context for the deployed application that is associated with the specified context path (if any); otherwise return null. |
java.lang.String[] |
findDeployedApps()
Return the context paths of all deployed web applications in this Container. |
java.lang.String |
getName()
Return the name of the Container with which this Deployer is associated. |
void |
install(java.lang.String contextPath,
java.net.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(java.net.URL war)
Installs a new web application from the web application archive at the specified URL, which must contain a META-INF/context.xml context configuration file (consisting of a <Context>
element). |
void |
install(java.net.URL config,
java.net.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. |
boolean |
isDeployXML()
Returns true if context.xml config files are supported. |
void |
remove(java.lang.String contextPath)
Remove an existing web application, attached to the specified context path. |
void |
remove(java.lang.String contextPath,
boolean undeploy)
Remove an existing web application, attached to the specified context path. |
void |
start(java.lang.String contextPath)
Start an existing web application, attached to the specified context path. |
void |
stop(java.lang.String contextPath)
Stop an existing web application, attached to the specified context path. |
| Field Detail |
public static final java.lang.String PRE_INSTALL_EVENT
install(), before it has been
started.
public static final java.lang.String INSTALL_EVENT
install(), after it has been started.
public static final java.lang.String REMOVE_EVENT
remove().
| Method Detail |
public java.lang.String getName()
public void install(java.lang.String contextPath,
java.net.URL war)
throws java.io.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 installed
java.lang.IllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)
java.lang.IllegalStateException - if the specified context path
is already attached to an existing web application
java.io.IOException - if an input/output error was encountered
during installation
public void install(java.net.URL config,
java.net.URL war)
throws java.io.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 installed
java.lang.IllegalArgumentException - if one of the specified URLs is
null
java.lang.IllegalStateException - if the context path specified in the
context configuration file is already attached to an existing web
application
java.io.IOException - if an input/output error was encountered
during installation
public void install(java.net.URL war)
throws java.io.IOException
<Context>
element).
The web application is installed at the path specified inside the embedded META-INF/context.xml. The docBase (if any) specified inside the embedded META-INF/context.xml is overridden with the web application's location.
If the installation succeeds, a ContainerEvent of type
INSTALL_EVENT is sent to all registered listeners,
with the newly created Context as its argument.
war - URL pointing to web application location (WAR-packaged or
unpacked directory)
java.lang.IllegalArgumentException - if war is null, or if
the deployment host does not support any context.xml
configuration files
java.lang.IllegalStateException - if the context path specified in the
context configuration file is already in use by an existing
web application
java.io.IOException - if an input/output error was encountered
during installationpublic Context findDeployedApp(java.lang.String contextPath)
null.
contextPath - The context path of the requested web applicationpublic java.lang.String[] findDeployedApps()
public void remove(java.lang.String contextPath)
throws java.io.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 removed
java.lang.IllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)
java.lang.IllegalArgumentException - if the specified context path does
not identify a currently installed web application
java.io.IOException - if an input/output error occurs during
removal
public void remove(java.lang.String contextPath,
boolean undeploy)
throws java.io.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 server
java.lang.IllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)
java.lang.IllegalArgumentException - if the specified context path does
not identify a currently installed web application
java.io.IOException - if an input/output error occurs during
removal
public void start(java.lang.String contextPath)
throws java.io.IOException
contextPath - The context path of the application to be started
java.lang.IllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)
java.lang.IllegalArgumentException - if the specified context path does
not identify a currently installed web application
java.io.IOException - if an input/output error occurs during
startup
public void stop(java.lang.String contextPath)
throws java.io.IOException
contextPath - The context path of the application to be stopped
java.lang.IllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)
java.lang.IllegalArgumentException - if the specified context path does
not identify a currently installed web application
java.io.IOException - if an input/output error occurs while stopping
the web applicationpublic boolean isDeployXML()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||