Skip to content

Commit

Permalink
PLANNER-1540 Check if solver got lost from http session
Browse files Browse the repository at this point in the history
  • Loading branch information
rsynek authored and ge0ffrey committed Jun 27, 2019
1 parent 6e854ca commit 3f40ab9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public void setup(HttpSession session) {

public void solve(final HttpSession session) {
final Solver<CloudBalance> solver = (Solver<CloudBalance>) session.getAttribute(CloudBalancingSessionAttributeName.SOLVER);
if (solver == null) {
throw new IllegalStateException("Solver (" + solver + ") cannot be null. As the Solver is not serializable, "
+ "it might have got lost during a passivation.");
}

final CloudBalance unsolvedSolution = (CloudBalance) session.getAttribute(CloudBalancingSessionAttributeName.SHOWN_SOLUTION);

solver.addEventListener(new SolverEventListener<CloudBalance>() {
Expand Down

0 comments on commit 3f40ab9

Please sign in to comment.