[jboss-cvs] JBossAS SVN: r83314 - branches/Branch_5_0/server/src/main/org/jboss/web/deployers.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jan 22 13:21:13 EST 2009
Author: scott.stark at jboss.org
Date: 2009-01-22 13:21:12 -0500 (Thu, 22 Jan 2009)
New Revision: 83314
Modified:
branches/Branch_5_0/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: branches/Branch_5_0/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
===================================================================
--- branches/Branch_5_0/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java 2009-01-22 18:20:27 UTC (rev 83313)
+++ branches/Branch_5_0/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java 2009-01-22 18:21:12 UTC (rev 83314)
@@ -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