try {
com.sun.enterprise.config.serverbeans.Application app_w = dc.getTransientAppMetaData(com.sun.enterprise.config.serverbeans.ServerTags.APPLICATION, com.sun.enterprise.config.serverbeans.Application.class);
if (app_w != null) {
if (application.isVirtual()) {
Module modConfig = app_w.createChild(Module.class);
app_w.getModule().add(modConfig);
modConfig.setName(application.getRegistrationName());
} else {
for (ModuleDescriptor moduleDesc :
application.getModules()) {
Module modConfig = app_w.createChild(Module.class);
app_w.getModule().add(modConfig);
modConfig.setName(moduleDesc.getArchiveUri());
}
}
}
} catch (Exception e) {
Logger.getAnonymousLogger().log(Level.WARNING, "failed to add the module config", e);