private static Logger log = LoggerFactory.getLogger(SchedulerImpl.class);
public Provider schedule(InvocationContext context) throws SchedulerException {
Registry registryService = context.getExecutionContext().getRegistryService();
/*
* Load Service
*/
ServiceDescription serviceDesc = null;
try {
serviceDesc = registryService.getServiceDescription(context.getServiceName());
} catch (RegistryException e2) {
e2.printStackTrace();
}
if (serviceDesc == null)
throw new SchedulerException("Service Desciption for " + context.getServiceName()
+ " does not found on resource Catalog " + registryService);
/*
* Load host
*/
HostDescription host = scheduleToHost(registryService, context.getServiceName());
if (host == null)
throw new SchedulerException("Host Desciption for " + context.getServiceName()
+ " does not found on resource Catalog " + registryService);
/*
* Load app
*/
ApplicationDeploymentDescription app = null;
try {
app = registryService.getDeploymentDescription(context.getServiceName(), host.getType().getHostName());
} catch (RegistryException e2) {
e2.printStackTrace();
}
if (app == null)