fr.ifremer.isisfish.simulator.launcher
Class SimulationService.PrepareSimulationJob

java.lang.Object
  extended by fr.ifremer.isisfish.simulator.launcher.SimulationService.PrepareSimulationJob
All Implemented Interfaces:
SimulationJob.PostAction, Runnable, Iterator<SimulationJob>
Enclosing class:
SimulationService

public static class SimulationService.PrepareSimulationJob
extends Object
implements Runnable, Iterator<SimulationJob>, SimulationJob.PostAction

Permet de genere les sous simulations d'un plan d'analyse. Pour les plan independant, on l'utilise en Runnable pour genere tous les plans possible et les soumettre a la queue. Pour les plans dependant on l'utilise seulement comme iterator. La methode afterSimulation des plans est appelee automatiquement a la fin de la simulation grace au mecanisme de PostAction sur les SimulationJob.


Field Summary
protected  SimulationControl control
           
protected  int done
           
protected  boolean doNext
           
protected  String id
           
protected  SimulationJob job
           
protected  SimulationJob nextJob
           
protected  SimulationParameter param
           
protected  AnalysePlanContext planContext
           
protected  SimulationService simulationService
           
 
Constructor Summary
SimulationService.PrepareSimulationJob(SimulationService simulationService, SimulationJob job)
           
 
Method Summary
 void exception(SimulationJob job, Throwable eee)
          Appeler lorsque la simulation a echoué.
 void finished(SimulationJob job, SimulationStorage sim)
          Appelé lorsque la simulation s'arrete normalement.
 boolean hasNext()
          Indique s'il y a encore des simulations dans le plan.
 SimulationJob next()
           
 void remove()
           
 void run()
          Genere toutes les sous simulations et les places dans la queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

simulationService

protected SimulationService simulationService

planContext

protected AnalysePlanContext planContext

job

protected SimulationJob job

nextJob

protected SimulationJob nextJob

doNext

protected boolean doNext

id

protected String id

control

protected SimulationControl control

param

protected SimulationParameter param

done

protected int done
Constructor Detail

SimulationService.PrepareSimulationJob

public SimulationService.PrepareSimulationJob(SimulationService simulationService,
                                              SimulationJob job)
Method Detail

run

public void run()
Genere toutes les sous simulations et les places dans la queue. Cette methode run() est appelée seulement dans le cas de la génération de plans indépendants.

Specified by:
run in interface Runnable
See Also:
pour les plans dépendants

hasNext

public boolean hasNext()
Indique s'il y a encore des simulations dans le plan. Par defaut pour Eviter les plans sans fin, le nombre de plan genere par simulation est limite a SimulationService.MAX_PLAN_SIMULATION

Specified by:
hasNext in interface Iterator<SimulationJob>
Returns:
true if has next

next

public SimulationJob next()
Specified by:
next in interface Iterator<SimulationJob>

remove

public void remove()
Specified by:
remove in interface Iterator<SimulationJob>

finished

public void finished(SimulationJob job,
                     SimulationStorage sim)
Description copied from interface: SimulationJob.PostAction
Appelé lorsque la simulation s'arrete normalement.

Specified by:
finished in interface SimulationJob.PostAction
Parameters:
job - le job qui a fait la simulation
sim - la simulation qui vient d'etre faite

exception

public void exception(SimulationJob job,
                      Throwable eee)
Description copied from interface: SimulationJob.PostAction
Appeler lorsque la simulation a echoué.

Specified by:
exception in interface SimulationJob.PostAction
Parameters:
job - le job qui a fait la simulation
eee - l'exception qui a ete levee


Copyright © 1999-2011 CodeLutin. All Rights Reserved.