r3568 - branches/isis-fish-3.3.0.x/src/main/java/fr/ifremer/isisfish/simulator/launcher
Author: echatellier Date: 2011-12-19 16:06:47 +0100 (Mon, 19 Dec 2011) New Revision: 3568 Url: http://forge.codelutin.com/repositories/revision/isis-fish/3568 Log: #609: Les plans de simulations sont reinstanci?\195?\169s durant une simulation Modified: branches/isis-fish-3.3.0.x/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java Modified: branches/isis-fish-3.3.0.x/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java =================================================================== --- branches/isis-fish-3.3.0.x/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2011-12-19 14:38:07 UTC (rev 3567) +++ branches/isis-fish-3.3.0.x/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2011-12-19 15:06:47 UTC (rev 3568) @@ -704,6 +704,7 @@ protected SimulationControl control; protected SimulationParameter param; protected int done = 0; + protected List<AnalysePlan> analyzePlan; public PrepareSimulationJob(SimulationService simulationService, SimulationJob job) { @@ -712,11 +713,16 @@ id = job.getItem().getControl().getId(); control = job.getItem().getControl(); param = job.getItem().getParameter(); + // take a copy of simulation paln list + // because they a freed during simulation (soft reference) + // is there is not enought memory available + analyzePlan = param.getAnalysePlans(); + this.planContext = new AnalysePlanContext(control.getId(), param); try { // appel de init sur chaque plan - for (AnalysePlan plan : param.getAnalysePlans()) { + for (AnalysePlan plan : analyzePlan) { plan.init(planContext); } } catch (Exception eee) { @@ -842,7 +848,7 @@ sim.getParameter().setAnalysePlanNumber(planNumber); // appel de tous les plans pour modifier la simulation - for (AnalysePlan plan : param.getAnalysePlans()) { + for (AnalysePlan plan : analyzePlan) { result = result && plan.beforeSimulation(planContext, sim); if (!result) { @@ -917,7 +923,7 @@ // appel de tous les plans pour modifier la simulation // EC20090716 : use param.getAnalysePlans() instances, // not sim.getParameters().getAnalysePlans() not sames !!! - for (AnalysePlan plan : param.getAnalysePlans()) { + for (AnalysePlan plan : analyzePlan) { try { boolean result = plan.afterSimulation(planContext, sim); doNext = doNext && result;
participants (1)
-
echatellier@users.forge.codelutin.com