[jboss-cvs] JBossAS SVN: r83307 - trunk/server/src/main/org/jboss/web/deployers.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jan 22 12:30:39 EST 2009
Author: scott.stark at jboss.org
Date: 2009-01-22 12:30:38 -0500 (Thu, 22 Jan 2009)
New Revision: 83307
Modified:
trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
Log:
JBAS-6319, incorporate the virtual host if one exists into the generated war object name to avoid conflicts when multiple wars have different virtual hosts with the same context
Modified: trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java 2009-01-22 16:42:08 UTC (rev 83306)
+++ trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java 2009-01-22 17:30:38 UTC (rev 83307)
@@ -636,17 +636,25 @@
* Get the object name of the ServiceMetaData instance associated with
* the WebMetaData. This uses the pattern:
* "jboss.web.deployment:war="+metaData.getContextRoot()
- *
+ * if there are no virtual hosts, otherwise
+ * "jboss.web.deployment:war="+metaData.getVirtualHosts()[0]+metaData.getContextRoot()
* @param metaData - the web app metaData
- * @return "jboss.web.deployment:war="+metaData.getContextRoot();
+ * @return the war object name
*/
protected String getObjectName(JBossWebMetaData metaData)
{
+ // Obtain the war virtual host and context root to define a unique war name
+ String virtualHost = "";
+ List<String> hosts = metaData.getVirtualHosts();
+ if(hosts != null && hosts.size() > 0)
+ {
+ virtualHost = hosts.get(0);
+ }
String ctxPath = metaData.getContextRoot();
// The ctx path value cannot be empty in the object name
if (ctxPath == null || ctxPath.length() == 0)
ctxPath = "/";
- String objectName = "jboss.web.deployment:war=" + ctxPath;
+ String objectName = "jboss.web.deployment:war=" + virtualHost + ctxPath;
return objectName;
}
More information about the jboss-cvs-commits
mailing list