Map<String, ApplicationDescription> applicationDescriptors = airavataRegistry2.getApplicationDescriptors(serviceName);
for (String hostDescName : applicationDescriptors.keySet()) {
registeredHosts.add(airavataRegistry2.getHostDescriptor(hostDescName));
}
Class<? extends HostScheduler> aClass = Class.forName(ServerSettings.getHostScheduler()).asSubclass(HostScheduler.class);
HostScheduler hostScheduler = aClass.newInstance();
hostDescription = hostScheduler.schedule(registeredHosts);
hostName = hostDescription.getType().getHostName();
}
if(hostDescription == null){
throw new GFacException("Error executing the job as the host is not registered " + hostName);
}