From: markt Date: Fri, 28 Jan 2011 21:04:55 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50679 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=60a28cc1cdbc30a9ff61cde4521d60f1a9fbed3f;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50679 Update the FarmWarDeployer to support parallel deployment. This deliberately breaks the API since the meaning of a number of method parameters has changed (context path -> context name). git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1064881 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/ha/ClusterDeployer.java b/java/org/apache/catalina/ha/ClusterDeployer.java index d5df1bfcc..fec4f85e2 100644 --- a/java/org/apache/catalina/ha/ClusterDeployer.java +++ b/java/org/apache/catalina/ha/ClusterDeployer.java @@ -24,8 +24,8 @@ package org.apache.catalina.ha; * @author Filip Hanik * @version $Id$ */ +import java.io.File; import java.io.IOException; -import java.net.URL; import org.apache.catalina.LifecycleException; import org.apache.catalina.tribes.ChannelListener; @@ -48,59 +48,48 @@ public interface ClusterDeployer extends ChannelListener { public void stop() throws LifecycleException; /** - * Sets the deployer for this cluster deployer to use. - * @param deployer Deployer - */ - // FIXME - //public void setDeployer(Deployer deployer); - - /** * Install a new web application, whose web application archive is at the * specified URL, into this container and all the other - * members of the cluster with the specified context path. - * A context path of "" (the empty string) should be used for the root - * application for this container. Otherwise, the context path must - * start with a slash. + * members of the cluster with the specified context name. *

* If this application is successfully installed locally, * a ContainerEvent of type * INSTALL_EVENT will be sent to all registered listeners, * with the newly created Context as an argument. * - * @param contextPath The context path to which this application should + * @param contextName The context name to which this application should * be installed (must be unique) - * @param 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 + * @param wepapp A WAR file or unpacked directory structure containing + * the web application to be installed * - * @exception IllegalArgumentException if the specified context path - * is malformed (it must be "" or start with a slash) - * @exception IllegalStateException if the specified context path + * @exception IllegalArgumentException if the specified context name + * is malformed + * @exception IllegalStateException if the specified context name * is already attached to an existing web application * @exception IOException if an input/output error was encountered * during installation */ - public void install(String contextPath, URL war) throws IOException; + public void install(String contextName, File webapp) throws IOException; /** * Remove an existing web application, attached to the specified context - * path. If this application is successfully removed, a + * name. If this application is successfully removed, a * ContainerEvent of type 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. * - * @param contextPath The context path of the application to be removed + * @param contextName The context name of the application to be removed * @param undeploy boolean flag to remove web application from server * - * @exception IllegalArgumentException if the specified context path - * is malformed (it must be "" or start with a slash) - * @exception IllegalArgumentException if the specified context path does + * @exception IllegalArgumentException if the specified context name + * is malformed + * @exception IllegalArgumentException if the specified context name does * not identify a currently installed web application * @exception IOException if an input/output error occurs during * removal */ - public void remove(String contextPath, boolean undeploy) throws IOException; + public void remove(String contextName, boolean undeploy) throws IOException; /** * call from container Background Process diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java index eb1117e71..f4d872993 100644 --- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java +++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java @@ -19,7 +19,6 @@ package org.apache.catalina.ha.deploy; import java.io.File; import java.io.IOException; -import java.net.URL; import java.util.HashMap; import javax.management.MBeanServer; @@ -35,6 +34,7 @@ import org.apache.catalina.ha.ClusterDeployer; import org.apache.catalina.ha.ClusterListener; import org.apache.catalina.ha.ClusterMessage; import org.apache.catalina.tribes.Member; +import org.apache.catalina.util.ContextName; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.modeler.Registry; @@ -44,7 +44,7 @@ import org.apache.tomcat.util.res.StringManager; /** *

* A farm war deployer is a class that is able to deploy/undeploy web - * applications in WAR form within the cluster. + * applications in WAR from within the cluster. *

* Any host can act as the admin, and will have three directories *