Search in sources :

Example 16 with SchedulerException

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);
}
Also used : SchedulerException(org.ow2.proactive.scheduler.common.exception.SchedulerException) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Example 17 with SchedulerException

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;
}
Also used : MonitorEventReceiver(functionaltests.monitor.MonitorEventReceiver) SchedulerState(org.ow2.proactive.scheduler.common.SchedulerState) SchedulerProxyUserInterface(org.ow2.proactive.scheduler.common.util.SchedulerProxyUserInterface) CredData(org.ow2.proactive.authentication.crypto.CredData) PAActiveObject(org.objectweb.proactive.api.PAActiveObject) SchedulerMonitorsHandler(functionaltests.monitor.SchedulerMonitorsHandler)

Aggregations

CredData (org.ow2.proactive.authentication.crypto.CredData)7 SchedulerAuthenticationInterface (org.ow2.proactive.scheduler.common.SchedulerAuthenticationInterface)5 KeyException (java.security.KeyException)4 LoginException (javax.security.auth.login.LoginException)4 Credentials (org.ow2.proactive.authentication.crypto.Credentials)4 InternalSchedulerException (org.ow2.proactive.scheduler.common.exception.InternalSchedulerException)4 SchedulerException (org.ow2.proactive.scheduler.common.exception.SchedulerException)4 SchedulerProxyUserInterface (org.ow2.proactive.scheduler.common.util.SchedulerProxyUserInterface)3 PublicKey (java.security.PublicKey)2 HttpSession (javax.servlet.http.HttpSession)2 Consumes (javax.ws.rs.Consumes)2 POST (javax.ws.rs.POST)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 ActiveObjectCreationException (org.objectweb.proactive.ActiveObjectCreationException)2 NodeException (org.objectweb.proactive.core.node.NodeException)2 SchedulerState (org.ow2.proactive.scheduler.common.SchedulerState)2 JobId (org.ow2.proactive.scheduler.common.job.JobId)2 MBeanInfoViewer (org.ow2.proactive.utils.console.MBeanInfoViewer)2 Session (org.ow2.proactive_grid_cloud_portal.common.Session)2