// deleted. DO NOT recreate cloud application modules for these
// CHANGE
for (IModule module : server.getModules()) {
// Find the corresponding Cloud Foundry application module for
// the given WST server IModule
CloudFoundryApplicationModule cloudModule = getCloudModule(module);
if (cloudModule == null) {
CloudFoundryPlugin.logError("Unable to find local Cloud Foundry application module for : " //$NON-NLS-1$
+ module.getName()
+ ". Try refreshing applications or disconnecting and reconnecting to the server."); //$NON-NLS-1$
continue;
}
// Now process the deployed application, and re-categorise it if
// necessary (i.e. whether it's external or not)
CloudApplication actualApplication = deployedApplications.remove(cloudModule
.getDeployedApplicationName());
// Update the cloud module mapping to the cloud application,
// such that the cloud module
// has the latest cloud application reference.
cloudModule.setCloudApplication(actualApplication);
// the modules maps to an existing application
if (actualApplication != null) {
if (cloudModule.isExternal()) {
externalModules.add(cloudModule);
}
allModules.add(cloudModule);
}
else if (getData() != null && getData().isUndeployed(module)) {
// deployment is still in progress
allModules.add(cloudModule);
}
else {
// the module maps to an application that no longer exists
deletedModules.add(module);
}
}
// create modules for new applications
if (getData() != null) {
for (CloudApplication application : deployedApplications.values()) {
CloudFoundryApplicationModule appModule = getData().createModule(application);
externalModules.add(appModule);
allModules.add(appModule);
}
}
// update state for cloud applications
server.setExternalModules(externalModules.toArray(new IModule[0]));
for (IModule module : server.getModules()) {
CloudFoundryApplicationModule appModule = getExistingCloudModule(module);
if (appModule != null) {
updateState(server, appModule);
}
}