|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
fr.ifremer.isisfish.simulator.launcher.SimulationMonitor
public class SimulationMonitor
Moniteur singleton pour pouvoir sauvegarder localement la liste des
simulations démarrées et permettre de continuer le monitoring au
relancemenent d'Isis.
Depuis la version 3.3, elle sauvegarde en plus les zip pour pouvoir
relancer une simulation même si isis a été arreté entre temps.
Cette classe n'implemente pas SimulationServiceListener
car elle ne doit pas écouter toutes les simulations, mais
seulement celle dit simple, c'est-à-dire "master plan" du plan
d'analyse.
Il faut bien faire attention lors du relancement des simulations a copier
le zip a un autre endroit. Il est important d'avoir deux zip car celui
de la sauvegarde est supprimé des que la simulation est arrete.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected Timer |
checkScheduler
Check scheduler. |
protected SortedSet<AbstractMap.SimpleEntry<Date,SimulationJob>> |
checkSet
Map to remember when a simulation have to be checked. |
protected static SimulationMonitor |
instance
Instance. |
protected File |
monitorFolder
Simulation information saving file. |
protected static String |
PROPERTIES_FILE
|
protected static String |
PROPERTY_DATE
|
protected static String |
PROPERTY_LASTSIMULATION
|
protected static String |
PROPERTY_LAUNCHER
|
protected static String |
PROPERTY_STANDALONE
|
protected static String |
PROPERTY_ZIP
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
SimulationMonitor()
Constructeur. |
| Method Summary | |
|---|---|
protected void |
analyzeSensitivityResult(SimulationJob job,
SimulationStorage simulation)
For each finished simulation, check that all sensitivity simulation are available (in case of sensitivity simulation only). |
protected boolean |
checkProgression(SimulationJob job,
SimulatorLauncher launcher)
Check progression. |
protected boolean |
doPostSimulationOperation(SimulationJob job,
SimulatorLauncher launcher)
Operation to do after simulation end. |
static SimulationMonitor |
getInstance()
Instance getter. |
protected int |
getNumberOfFinishedSimulation(String asPrefixName,
int numberOfSimulation)
Parcourt le dossier de toutes les simulation commencant par le prefix donné, et retourne le nombre de simulation terminées. |
protected List<SimulationStorage> |
getStorageListForSecondPass(String asPrefixName,
int numberOfSimulation)
Parcourt les dossiers et instancie les storages une fois qu'on est sur qu'on a toutes les simulations. |
void |
reloadConfig(SimulationService service)
Reload config and read non simulation job into simulation service. |
protected void |
restartSimulation(SimulationService service,
File simulationFolder,
String simulationId,
Properties propertiesFile)
Restart a single simulation. |
protected void |
restartSimulationProgression(SimulationService service)
Take all simulation in loaded file. |
void |
run()
|
void |
simulationStart(SimulationJob job)
Save simulation informations for started simulations. |
void |
simulationStop(SimulationJob job)
Mark a simulation as stopped. |
protected void |
waitAndCheckProgression()
Wait a little time, and check for first simulation progression, if first simulation time is reached. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String PROPERTIES_FILE
protected static final String PROPERTY_LAUNCHER
protected static final String PROPERTY_DATE
protected static final String PROPERTY_ZIP
protected static final String PROPERTY_STANDALONE
protected static final String PROPERTY_LASTSIMULATION
protected static SimulationMonitor instance
protected File monitorFolder
protected SortedSet<AbstractMap.SimpleEntry<Date,SimulationJob>> checkSet
protected Timer checkScheduler
| Constructor Detail |
|---|
protected SimulationMonitor()
| Method Detail |
|---|
public static SimulationMonitor getInstance()
public void reloadConfig(SimulationService service)
service - SimulationServiceprotected void restartSimulationProgression(SimulationService service)
protected void restartSimulation(SimulationService service,
File simulationFolder,
String simulationId,
Properties propertiesFile)
throws IOException
service - simulation servicesimulationFolder - simulation information foldersimulationId - simulation idpropertiesFile - simulation properties file
IOExceptionpublic void simulationStart(SimulationJob job)
job - started jobpublic void simulationStop(SimulationJob job)
job - job that control the simulationpublic void run()
run in interface Runnablerun in class Threadprotected void waitAndCheckProgression()
protected boolean checkProgression(SimulationJob job,
SimulatorLauncher launcher)
job - job to check progressionlauncher - SimulatorLauncher that manage simulation
protected boolean doPostSimulationOperation(SimulationJob job,
SimulatorLauncher launcher)
job - joblauncher - SimulatorLauncher that manage simulation
protected void analyzeSensitivityResult(SimulationJob job,
SimulationStorage simulation)
job - jobsimulation - simulation
protected int getNumberOfFinishedSimulation(String asPrefixName,
int numberOfSimulation)
asPrefixName - simulation name (without number suffix)numberOfSimulation - total simulation number
protected List<SimulationStorage> getStorageListForSecondPass(String asPrefixName,
int numberOfSimulation)
asPrefixName - simulation name (without number suffix)numberOfSimulation - total simulation number
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||