use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.
the class JobResultDecorator method jobRunningToFinishedEvent.
@Override
protected void jobRunningToFinishedEvent(NotificationData<JobInfo> event) {
super.jobRunningToFinishedEvent(event);
JobId jobId = event.getData().getJobId();
if (!this.mapOfJobs.containsKey(jobId)) {
logger.trace("We are not waiting for the result of job ID " + jobId);
return;
}
logger.trace("Trying to get the job result for job " + jobId);
try {
logger.info("The result for job with ID " + jobId + " is " + this.daddy.getJobResult(jobId));
} catch (SchedulerException e) {
logger.error("Cannot get the job result for job with id " + jobId + " from the scheduler", e);
}
// we have the result => stop monitoring this job
this.stopMonitoring(jobId);
}
use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.
the class SchedulerTestUser method connect.
/**
* Connects the singleton using the given user
*/
public boolean connect(String username, String password, byte[] key, String schedulerUrl) throws LoginException, KeyException, ActiveObjectCreationException, NodeException, SchedulerException {
this.connectedUserName = username;
this.connectedUserPassword = password;
this.connectedUserKey = key;
disconnectFromScheduler();
if (schedulerProxy == null) {
schedulerProxy = PAActiveObject.newActive(SchedulerProxyUserInterface.class, new Object[0]);
}
SchedulerTHelper.log("Connecting user " + connectedUserName + " to the Scheduler at url " + schedulerUrl);
CredData connectedUserCreds = new CredData(CredData.parseLogin(connectedUserName), CredData.parseDomain(connectedUserName), connectedUserPassword, connectedUserKey);
schedulerProxy.init(schedulerUrl, connectedUserCreds);
monitorsHandler = new SchedulerMonitorsHandler();
if (eventReceiver != null) {
PAActiveObject.terminateActiveObject(eventReceiver, true);
}
/**
* create event receiver then turnActive to avoid deepCopy of MonitorsHandler object
* (shared instance between event receiver and static helpers).
*/
MonitorEventReceiver passiveEventReceiver = new MonitorEventReceiver(monitorsHandler);
eventReceiver = PAActiveObject.turnActive(passiveEventReceiver);
SchedulerState state = schedulerProxy.addEventListener(eventReceiver, true, true);
monitorsHandler.init(state);
return true;
}
Aggregations