changeset 1649:74142aa5d938

Improved WSPLGEN start to suppress inconsistent Artifact states. flys-artifacts/trunk@2836 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Sep 2011 11:33:45 +0000
parents d1d6fd8cfbb2
children aaf8d32f85bd
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java flys-artifacts/src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java
diffstat 3 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Sep 27 10:53:41 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Sep 27 11:33:45 2011 +0000
@@ -1,3 +1,13 @@
+2011-09-27  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java:
+	  Put Artifact in background mode first before starting WSPLGEN, otherwise
+	  a very fast errors (call CallContext.afterBackground() before Artifact is
+	  in Background mode) might lead to an inconsistent state.
+
+	* src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java: Repaired
+	  broken error num parsing.
+
 2011-09-27  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java: Track
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Tue Sep 27 10:53:41 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Tue Sep 27 11:33:45 2011 +0000
@@ -252,9 +252,6 @@
             return null;
         }
 
-        Scheduler scheduler = Scheduler.getInstance();
-        scheduler.addJob(job);
-
         facetCreator.createWSPLGENFacet();
 
         facets.addAll(facetCreator.getFacets());
@@ -269,6 +266,9 @@
                 "wsplgen.job.queued")
         ));
 
+        Scheduler scheduler = Scheduler.getInstance();
+        scheduler.addJob(job);
+
         return null;
     }
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java	Tue Sep 27 10:53:41 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/ProblemObserver.java	Tue Sep 27 11:33:45 2011 +0000
@@ -63,7 +63,7 @@
         Matcher startError = WSPLGEN_ERROR_START.matcher(log);
         if (startError.matches()) {
             if (startError.groupCount() >= 2) {
-                String tmp = startError.group(2);
+                String tmp = startError.group(3);
 
                 if (tmp != null && tmp.length() > 0) {
                     error = Integer.parseInt(tmp);

http://dive4elements.wald.intevation.org