Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/wsplgen/JobObserver.java @ 1157:a470b7c3b165
Write status messages and progress information of WSPLGEN Calculations into Artifact's DESCRIBE document.
flys-artifacts/trunk@2689 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 09 Sep 2011 15:03:00 +0000 |
parents | e7d5452a7381 |
children | 453d2d0c4258 |
comparison
equal
deleted
inserted
replaced
1156:4da9f058fed6 | 1157:a470b7c3b165 |
---|---|
7 import java.util.regex.Matcher; | 7 import java.util.regex.Matcher; |
8 import java.util.regex.Pattern; | 8 import java.util.regex.Pattern; |
9 | 9 |
10 import org.apache.log4j.Logger; | 10 import org.apache.log4j.Logger; |
11 | 11 |
12 import de.intevation.flys.artifacts.model.CalculationMessage; | |
12 import de.intevation.flys.artifacts.model.WSPLGENJob; | 13 import de.intevation.flys.artifacts.model.WSPLGENJob; |
13 | 14 |
14 | 15 |
15 public class JobObserver extends Thread { | 16 public class JobObserver extends Thread { |
16 | 17 |
92 protected void update(String log) { | 93 protected void update(String log) { |
93 for (int num = patterns.length, i = 0; i < num; i++) { | 94 for (int num = patterns.length, i = 0; i < num; i++) { |
94 Matcher m = patterns[i].matcher(log); | 95 Matcher m = patterns[i].matcher(log); |
95 | 96 |
96 if (m.matches()) { | 97 if (m.matches()) { |
98 job.getCallContext().addBackgroundMessage( | |
99 new CalculationMessage(num, i+1, log)); | |
100 | |
97 logger.info("Finished step " + (i+1) + " / " + num); | 101 logger.info("Finished step " + (i+1) + " / " + num); |
98 } | 102 } |
99 } | 103 } |
100 } | 104 } |
101 } | 105 } |