use of org.ow2.proactive.scheduler.task.TaskLauncher in project scheduling by ow2-proactive.
the class ExecuterInformationData method toExecuterInformation.
/**
* Rebuild an executer information from the data. A stub to the task
* launcher is attempted to be retrieved.
* @param loadFullState whether it is important to have a task launcher
* stub in the end (it is important if the task is
* running)
*/
public ExecuterInformation toExecuterInformation(boolean loadFullState) {
TaskLauncher taskLauncher = null;
if (taskLauncherNodeUrl != null) {
try {
taskLauncher = PAActiveObject.lookupActive(TaskLauncher.class, taskLauncherNodeUrl);
logger.info("Retrieve task launcher " + taskLauncherNodeUrl + " successfully for task " + taskId);
} catch (Exception e) {
if (loadFullState) {
logger.warn("Task launcher " + taskLauncherNodeUrl + " of task " + taskId + " cannot be looked up, try to rebind it");
taskLauncher = getReboundTaskLauncherIfStillExist();
}
}
}
return new ExecuterInformation(taskLauncher, nodes, nodeName, hostName);
}
use of org.ow2.proactive.scheduler.task.TaskLauncher in project scheduling by ow2-proactive.
the class BaseServiceTest method taskStarted.
void taskStarted(JobDescriptor jobDesc, EligibleTaskDescriptor taskDesc) throws Exception {
InternalTask task = ((EligibleTaskDescriptorImpl) taskDesc).getInternal();
TaskLauncher launcher = Mockito.mock(TaskLauncher.class);
task.setExecuterInformation(new ExecuterInformation(launcher, NodeFactory.getDefaultNode()));
service.taskStarted(((JobDescriptorImpl) jobDesc).getInternal(), task, launcher);
}
Aggregations