{
public JSEArchiveMetaData buildUnifiedWebMetaData(Deployment dep, DeploymentInfo di)
{
String contextRoot = null;
WebMetaData wmd = (WebMetaData)di.metaData;
dep.addAttachment(WebMetaData.class, wmd);
if (di.parent != null)
{
J2eeApplicationMetaData appmd = (J2eeApplicationMetaData)di.parent.metaData;
if(appmd!=null) // An ESB case, They deploy a *.war inside *.esb
{
Iterator it = appmd.getModules();
while (it.hasNext())
{
J2eeModuleMetaData module = (J2eeModuleMetaData)it.next();
if (module.getFileName().equals(dep.getSimpleName()))
contextRoot = module.getWebContext();
}
}
}
if (contextRoot == null)
contextRoot = wmd.getContextRoot();
JSEArchiveMetaData webMetaData = new JSEArchiveMetaData();
webMetaData.setContextRoot(contextRoot);
webMetaData.setServletMappings(wmd.getServletMappings());
webMetaData.setServletClassNames(getServletClassMap(wmd));
webMetaData.setConfigName(wmd.getConfigName());
webMetaData.setConfigFile(wmd.getConfigFile());
webMetaData.setSecurityDomain(wmd.getSecurityDomain());
webMetaData.setPublishLocationAdapter(getPublishLocationAdpater(wmd));
webMetaData.setSecurityMetaData(getSecurityMetaData(wmd.getSecurityContraints()));
return webMetaData;
}