private void addModules(JarFile earFile, ApplicationType application, GerApplicationType gerApplication, Set moduleLocations, Set modules) throws DeploymentException {
Map altVendorDDs = new HashMap();
try {
// build map from module path to alt vendor dd
GerModuleType gerModuleTypes[] = gerApplication.getModuleArray();
for (int i = 0; i < gerModuleTypes.length; i++) {
GerModuleType gerModule = gerModuleTypes[i];
String path = null;
if (gerModule.isSetEjb()) {
path = gerModule.getEjb().getStringValue();
} else if (gerModule.isSetWeb()) {
path = gerModule.getWeb().getStringValue();
} else if (gerModule.isSetConnector()) {
path = gerModule.getConnector().getStringValue();
} else if (gerModule.isSetJava()) {
path = gerModule.getJava().getStringValue();
}
if (gerModule.isSetAltDd()) {
// the the url of the alt dd
try {
altVendorDDs.put(path, DeploymentUtil.toTempFile(earFile, gerModule.getAltDd().getStringValue()));
} catch (IOException e) {
throw new DeploymentException("Invalid alt vendor dd url: " + gerModule.getAltDd().getStringValue(), e);
}
} else {
//dd is included explicitly
XmlCursor cursor = gerModule.newCursor();
try {
cursor.toFirstChild();
cursor.toNextSibling();
//should be at the "any" element
XmlObject any = cursor.getObject();