[jboss-cvs] JBossAS SVN: r58326 - trunk/server/src/main/org/jboss/deployment
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Nov 13 23:04:29 EST 2006
Author: scott.stark at jboss.org
Date: 2006-11-13 23:04:18 -0500 (Mon, 13 Nov 2006)
New Revision: 58326
Modified:
trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java
Log:
Move the ear level settings to the jboss-web.xml deployer
Modified: trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java 2006-11-14 02:28:05 UTC (rev 58325)
+++ trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java 2006-11-14 04:04:18 UTC (rev 58326)
@@ -21,6 +21,7 @@
*/
package org.jboss.deployment;
+import org.jboss.deployers.plugins.deployers.helpers.AttachmentLocator;
import org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
@@ -97,6 +98,34 @@
{
log.debug("deploy, unit: "+unit);
createMetaData(unit, webXmlPath, null);
+ WebMetaData metaData = getMetaData(unit, WebMetaData.class.getName());
+ if( metaData == null )
+ return;
+
+ // Merge any settings from the ear level
+ J2eeApplicationMetaData earMetaData = AttachmentLocator.search(unit, J2eeApplicationMetaData.class);
+ if( earMetaData != null )
+ {
+ String path = unit.getRelativePath();
+ J2eeModuleMetaData webModule = earMetaData.getModule(path);
+ if( webModule != null )
+ {
+ // Check for a context-root setting
+ String contextRoot = metaData.getContextRoot();
+ if( contextRoot == null )
+ {
+ contextRoot = webModule.getWebContext();
+ metaData.setContextRoot(contextRoot);
+ }
+
+ // Add any alt-dd setting
+ metaData.setAltDDPath(webModule.getAlternativeDD());
+ }
+
+ // Merge security domain/roles
+ if( metaData.getSecurityDomain() == null )
+ metaData.setSecurityDomain(earMetaData.getSecurityDomain());
+ metaData.mergeSecurityRoles(earMetaData.getSecurityRoles());
+ }
}
-
}
More information about the jboss-cvs-commits
mailing list