use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.
the class SchedulerRMProxyFactory method connectToScheduler.
public SchedulerProxyUserInterface connectToScheduler(CredData credData) throws ActiveObjectCreationException, NodeException, LoginException, SchedulerException {
SchedulerProxyUserInterface scheduler = PAActiveObject.newActive(SchedulerProxyUserInterface.class, new Object[] {});
scheduler.init(PortalConfiguration.SCHEDULER_URL.getValueAsString(), credData);
return scheduler;
}
use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.
the class SchedulerRMProxyFactory method connectToScheduler.
public SchedulerProxyUserInterface connectToScheduler(Credentials credentials) throws LoginException, SchedulerException, ActiveObjectCreationException, NodeException {
SchedulerProxyUserInterface scheduler = PAActiveObject.newActive(SchedulerProxyUserInterface.class, new Object[] {});
scheduler.init(PortalConfiguration.SCHEDULER_URL.getValueAsString(), credentials);
return scheduler;
}
use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.
the class SmartProxyImpl method init.
@Override
public void init(ConnectionInfo connectionInfo) throws SchedulerException, LoginException {
this.connectionInfo = connectionInfo;
if (connectionInfo.getCredentialFile() != null) {
try {
Credentials credentials = Credentials.getCredentials(connectionInfo.getCredentialFile().getAbsolutePath());
init(connectionInfo.getUrl(), credentials);
} catch (KeyException e) {
throw new LoginException(e.getMessage());
}
} else {
CredData cred = new CredData(CredData.parseLogin(connectionInfo.getLogin()), CredData.parseDomain(connectionInfo.getLogin()), connectionInfo.getPassword());
init(connectionInfo.getUrl(), cred);
}
}
use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.
the class AbstractSchedulerUser method connectToScheduler.
public void connectToScheduler() throws SchedulerException, LoginException {
SchedulerAuthenticationInterface auth = SchedulerConnection.join(this.schedulerURL);
this.scheduler = auth.login(this.userCreds);
this.defaultParameter = this.scheduler;
}
use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.
the class AbstractSchedulerUser method registerListener.
public void registerListener(boolean getInitialState, boolean myEventsOnly, String listenerClazzName) throws SchedulerException, ProActiveException {
try {
if (this.scheduler == null)
throw new IllegalStateException("The user is not connected to the Scheduler yet. " + "Consider calling the connectToScheduler() method first");
SchedulerEventListener schedulerListener = createEventListener(listenerClazzName);
logger.trace("Trying to expose the listener as a remote object");
slExposer = new SchedulerListenerExposer(schedulerListener);
SchedulerEventListener schedulerListenerRemoteRef = slExposer.createRemoteReference();
logger.trace("Trying to register the listener to the Scheduler");
// for the moment, listens only to the Jobs-related events
SchedulerState initialState = scheduler.addEventListener(schedulerListenerRemoteRef, myEventsOnly, getInitialState, // job-related events
SchedulerEvent.JOB_SUBMITTED, SchedulerEvent.JOB_PENDING_TO_RUNNING, SchedulerEvent.JOB_PENDING_TO_FINISHED, SchedulerEvent.JOB_RUNNING_TO_FINISHED, SchedulerEvent.JOB_PAUSED, SchedulerEvent.JOB_RESUMED, SchedulerEvent.JOB_RESTARTED_FROM_ERROR, SchedulerEvent.JOB_CHANGE_PRIORITY, // task-related events
SchedulerEvent.TASK_PENDING_TO_RUNNING, SchedulerEvent.TASK_RUNNING_TO_FINISHED, SchedulerEvent.TASK_WAITING_FOR_RESTART, SchedulerEvent.USERS_UPDATE, // Scheduler state related events
SchedulerEvent.FROZEN, SchedulerEvent.RESUMED, SchedulerEvent.SHUTDOWN, SchedulerEvent.SHUTTING_DOWN, SchedulerEvent.STARTED, SchedulerEvent.STOPPED, SchedulerEvent.KILLED);
if (getInitialState) {
logger.info("Initial state of the scheduler is: " + initialState);
}
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Class " + listenerClazzName + " is not available on this SchedulerUser's side", e);
} catch (InstantiationException e) {
throw new IllegalArgumentException("Cannot instantiate listener of type " + listenerClazzName, e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Cannot instantiate listener of type " + listenerClazzName, e);
}
}
Aggregations