use of cbit.vcell.server.SimulationTaskID in project vcell by virtualcell.
the class SimulationControllerImpl method getSolverStatus.
/**
* This method was created by a SmartGuide.
* @return java.lang.String
* @exception java.rmi.RemoteException The exception description.
*/
public SolverStatus getSolverStatus(SimulationInfo simulationInfo, int jobIndex, int taskID) throws PermissionException, DataAccessException {
SimulationTaskID simTaskInfo = new SimulationTaskID(simulationInfo, jobIndex, taskID);
LocalSolverController solverController = solverControllerHash.get(simTaskInfo);
if (solverController == null) {
return new SolverStatus(SolverStatus.SOLVER_READY, SimulationMessage.MESSAGE_SOLVER_READY);
}
return solverController.getSolverStatus();
}
use of cbit.vcell.server.SimulationTaskID in project vcell by virtualcell.
the class SimulationControllerImpl method onServiceControlTopic_StopSimulation.
private void onServiceControlTopic_StopSimulation(VCMessage message) {
KeyValue simKey = new KeyValue(String.valueOf(message.getLongProperty(MessageConstants.SIMKEY_PROPERTY)));
int jobIndex = message.getIntProperty(MessageConstants.JOBINDEX_PROPERTY);
int taskID = message.getIntProperty(MessageConstants.TASKID_PROPERTY);
try {
SimulationTaskID simTaskInfo = new SimulationTaskID(simKey, jobIndex, taskID);
LocalSolverController solverController = solverControllerHash.get(simTaskInfo);
if (solverController != null) {
// can only start after updating the database is done
solverController.stopSimulationJob();
}
} catch (Exception e) {
lg.error(e.getMessage(), e);
VCSimulationIdentifier vcSimID = new VCSimulationIdentifier(simKey, localVCellConnection.getUserLoginInfo().getUser());
SimulationJobStatus newJobStatus = new SimulationJobStatus(VCellServerID.getSystemServerID(), vcSimID, jobIndex, null, SchedulerStatus.FAILED, taskID, SimulationMessage.jobFailed(e.getMessage()), null, null);
SimulationJobStatusEvent event = new SimulationJobStatusEvent(this, Simulation.createSimulationID(simKey), newJobStatus, null, null, vcSimID.getOwner().getName());
fireSimulationJobStatusEvent(event);
}
}
use of cbit.vcell.server.SimulationTaskID in project vcell by virtualcell.
the class SimulationControllerImpl method getOrCreateSolverController.
/**
* This method was created by a SmartGuide.
* @throws SolverException
* @throws DataAccessException
* @throws ConfigurationException
* @exception java.rmi.RemoteException The exception description.
* @throws JMSException
* @throws AuthenticationException
* @throws SQLException
* @throws FileNotFoundException
*/
LocalSolverController getOrCreateSolverController(SimulationTask simTask) throws FileNotFoundException, ConfigurationException, DataAccessException, AuthenticationException, SQLException, SolverException {
Simulation simulation = simTask.getSimulation();
VCSimulationIdentifier vcSimID = simulation.getSimulationInfo().getAuthoritativeVCSimulationIdentifier();
if (vcSimID == null) {
throw new IllegalArgumentException("cannot run an unsaved simulation");
}
if (!simulation.getVersion().getOwner().equals(localVCellConnection.getUserLoginInfo().getUser())) {
throw new PermissionException("insufficient privilege: startSimulation()");
}
SimulationTaskID simTaskInfo = new SimulationTaskID(simTask);
LocalSolverController solverController = solverControllerHash.get(simTaskInfo);
if (solverController == null) {
solverController = createNewSolverController(simTask);
solverControllerHash.put(simTaskInfo, solverController);
}
return solverController;
}
Aggregations