//start installing the resource adapters in the client.
Collection resourceModules = new ArrayList();
GerResourceType[] resources = gerAppClient.getResourceArray();
for (int i = 0; i < resources.length; i++) {
GerResourceType resource = resources[i];
String path;
JarFile connectorFile;
if (resource.isSetExternalRar()) {
path = resource.getExternalRar().trim();
Artifact artifact = Artifact.create(path);
File file = null;
for (Iterator iterator = repositories.iterator(); iterator.hasNext();) {
Repository repository = (Repository) iterator.next();
if (repository.contains(artifact)) {
file = repository.getLocation(artifact);
break;
}
}
if (file == null) {
throw new DeploymentException("Missing rar in repositories: " + path);
}
try {
connectorFile = new JarFile(file);
} catch (IOException e) {
throw new DeploymentException("Could not access rar contents", e);
}
} else {
path = resource.getInternalRar();
try {
connectorFile = new NestedJarFile(moduleFile, path);
} catch (IOException e) {
throw new DeploymentException("Could not locate connector inside ear", e);
}
}
XmlObject connectorPlan = resource.getConnector();
Module connectorModule = getConnectorModuleBuilder().createModule(connectorPlan, connectorFile, path, null, clientEnvironment, null, clientBaseName, naming, idBuilder);
resourceModules.add(connectorModule);
}
return new AppClientModule(standAlone, moduleName, clientBaseName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, gerAppClient, specDD, resourceModules);