if (!orchestratorConfiguration.isEmbeddedMode()) {
Map<String, Integer> gfacNodeList = airavataRegistry.getGFACNodeList();
if (gfacNodeList.size() == 0) {
String error = "No GFAC instances available in the system, Can't initialize Orchestrator";
logger.error(error);
throw new OrchestratorException(error);
}
Set<String> uriList = gfacNodeList.keySet();
Iterator<String> iterator = uriList.iterator();
// todo consume these data to
List<GFACInstance> gfacInstanceList = new ArrayList<GFACInstance>();
while (iterator.hasNext()) {
String uri = iterator.next();
Integer integer = gfacNodeList.get(uri);
gfacInstanceList.add(new GFACInstance(uri, integer));
}
}
orchestratorContext = new OrchestratorContext();
orchestratorContext.setOrchestratorConfiguration(orchestratorConfiguration);
orchestratorConfiguration.setAiravataAPI(getAiravataAPI());
orchestratorContext.setRegistry(airavataRegistry);
/* initializing registry cpi */
orchestratorContext.setNewRegistry(new RegistryImpl());
} catch (RegException e) {
logger.error("Failed to initializing Orchestrator");
OrchestratorException orchestratorException = new OrchestratorException(e);
throw orchestratorException;
} catch (AiravataConfigurationException e) {
logger.error("Failed to initializing Orchestrator");
OrchestratorException orchestratorException = new OrchestratorException(e);
throw orchestratorException;
} catch (IOException e) {
logger.error("Failed to initializing Orchestrator - Error parsing configuration files");
OrchestratorException orchestratorException = new OrchestratorException(e);
throw orchestratorException;
} catch (ApplicationSettingsException e) {
throw new OrchestratorException(e);
} catch (RegistryException e) {
logger.error("Failed to initializing Orchestrator - Error initializing registry");
OrchestratorException orchestratorException = new OrchestratorException(e);
throw orchestratorException;
}
}