if (!(new File(dir.toString()).exists())) {
dir = new StringBuffer(location).append(
File.separator).append(moduleName);
}
ExtensionModule em = new ExtensionModule();
//Hercules add
em.setConfigContext(eventConfigContext);
//end Hercules add
em.setName(moduleName);
// If the bundle descriptor has no context root, then
// its not a converged app. There is no contextRoot set.
try {
ElementProperty isConvergedProperty = new ElementProperty();
isConvergedProperty.setName("isConverged");
if(wbd.getContextRoot() != null) {
ElementProperty contextRootProperty =
new ElementProperty();
contextRootProperty.setName("contextRoot");
contextRootProperty.setValue(wbd.getContextRoot());
isConvergedProperty.setValue("true");
em.addElementProperty(contextRootProperty);
em.addElementProperty(isConvergedProperty);
} else {
isConvergedProperty.setValue("false");
em.addElementProperty(isConvergedProperty);
}
} catch (ConfigException ce) {
_logger.log(Level.WARNING,
"Error in adding context root: ", ce);
}
em.setLocation(dir.toString());
em.setEnabled(true);
em.setObjectType(resourceType);
wmInfo = new WebModuleConfig();
wmInfo.setBean(em);
wmInfo.setApplicationBean(j2eeAppBean);
wmInfo.setDescriptor(wbd);