changeset 1128:727c53fd0dc7

Some bugfixes when starting/finishing WSPLGEN jobs. flys-artifacts/trunk@2643 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 05 Sep 2011 07:17:52 +0000
parents 6b9877a9f6c1
children da3c3e286c88
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENJob.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java flys-artifacts/src/main/java/de/intevation/flys/wsplgen/JobExecutor.java
diffstat 4 files changed, 23 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Sep 02 13:12:05 2011 +0000
+++ b/flys-artifacts/ChangeLog	Mon Sep 05 07:17:52 2011 +0000
@@ -1,3 +1,16 @@
+2011-09-05  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/WSPLGENJob.java:
+	  Bugfixed broken attribute assignment.
+
+	* src/main/java/de/intevation/flys/wsplgen/JobExecutor.java: Call
+	  CallContext.afterBackground() after a WSPLGEN job has finished to remove
+	  the background lock from Artifact.
+
+	* src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java:
+	  Call CallContext.afterCall(BACKGROUND) to lock the Artifact for
+	  background processing.
+
 2011-09-02  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/wsplgen/JobExecutor.java: New. This
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENJob.java	Fri Sep 02 13:12:05 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WSPLGENJob.java	Mon Sep 05 07:17:52 2011 +0000
@@ -50,7 +50,7 @@
     public WSPLGENJob(FLYSArtifact flys, File workingDir, CallContext context) {
         this.artifact    = flys;
         this.workingDir  = workingDir;
-        this.callContext = callContext;
+        this.callContext = context;
 
         out   = -1;
         start = Double.NaN;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Fri Sep 02 13:12:05 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Mon Sep 05 07:17:52 2011 +0000
@@ -116,7 +116,7 @@
 
         facets.add(new WSPLGENFacet(0, FLOODMAP_WSPLGEN, "WSPLGEN"));
 
-        //context.afterCall(CallContext.BACKGROUND);
+        context.afterCall(CallContext.BACKGROUND);
 
         return null;
     }
--- a/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/JobExecutor.java	Fri Sep 02 13:12:05 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/wsplgen/JobExecutor.java	Mon Sep 05 07:17:52 2011 +0000
@@ -6,6 +6,8 @@
 
 import org.apache.log4j.Logger;
 
+import de.intevation.artifacts.CallContext;
+
 import de.intevation.flys.artifacts.model.WSPLGENJob;
 
 
@@ -72,25 +74,25 @@
                 }
                 catch (InterruptedException iee) { /* do nothing */ }
 
+                job.getCallContext().afterBackground(CallContext.STORE);
+
                 logger.info("WSPLGEN exit value: " + process.exitValue());
 
                 return;
             }
         }
         catch (SecurityException se) {
-            errorMsg = se.getMessage();
+            logger.error(se);
         }
         catch (IOException ioe) {
-            errorMsg = ioe.getMessage();
+            logger.error(ioe);
         }
         catch (NullPointerException npe) {
-            errorMsg = npe.getMessage();
+            logger.error(npe, npe);
         }
         catch (IndexOutOfBoundsException ioobe) {
-            errorMsg = ioobe.getMessage();
+            logger.error(ioobe, ioobe);
         }
-
-        logger.error("An error occured while starting WSPLGEN: " + errorMsg);
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org