use of cbit.vcell.solver.UserStopException in project vcell by virtualcell.
the class AbstractJavaSolver method runSolver.
/**
* Insert the method's description here.
* Creation date: (6/26/2001 3:08:31 PM)
*/
public void runSolver() {
try {
fieldRunning = true;
setSolverStatus(new SolverStatus(SolverStatus.SOLVER_STARTING, SimulationMessage.MESSAGE_SOLVER_STARTING_INIT));
fireSolverStarting(SimulationMessage.MESSAGE_SOLVEREVENT_STARTING_INIT);
initialize();
setSolverStatus(new SolverStatus(SolverStatus.SOLVER_RUNNING, SimulationMessage.MESSAGE_SOLVER_RUNNING_START));
fireSolverProgress(getProgress());
integrate();
setSolverStatus(new SolverStatus(SolverStatus.SOLVER_FINISHED, SimulationMessage.MESSAGE_SOLVER_FINISHED));
fireSolverFinished();
} catch (SolverException integratorException) {
lg.error(integratorException.getMessage(), integratorException);
SimulationMessage simulationMessage = SimulationMessage.solverAborted(integratorException.getMessage());
setSolverStatus(new SolverStatus(SolverStatus.SOLVER_ABORTED, simulationMessage));
fireSolverAborted(simulationMessage);
} catch (IOException ioException) {
lg.error(ioException.getMessage(), ioException);
SimulationMessage simulationMessage = SimulationMessage.solverAborted(ioException.getMessage());
setSolverStatus(new SolverStatus(SolverStatus.SOLVER_ABORTED, simulationMessage));
fireSolverAborted(simulationMessage);
} catch (UserStopException userStopException) {
lg.error(userStopException.getMessage(), userStopException);
setSolverStatus(new SolverStatus(SolverStatus.SOLVER_STOPPED, SimulationMessage.solverStopped(userStopException.getMessage())));
fireSolverStopped();
} catch (Exception e) {
lg.error("AbstractJavaSolver.runSolver() : Caught Throwable instead of SolverException -- THIS EXCEPTION SHOULD NOT HAPPEN!", e);
SimulationMessage simulationMessage = SimulationMessage.solverAborted(e.getMessage());
setSolverStatus(new SolverStatus(SolverStatus.SOLVER_ABORTED, simulationMessage));
fireSolverAborted(simulationMessage);
} finally {
fieldRunning = false;
}
}
Aggregations