Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/wsplgen/WSPLGENFuture.java @ 3818:dc18457b1cef
merged flys-artifacts/pre2.7-2012-03-16
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:59 +0200 |
parents | 368040e5c400 |
children |
comparison
equal
deleted
inserted
replaced
2456:60ab1054069d | 3818:dc18457b1cef |
---|---|
1 package de.intevation.flys.wsplgen; | |
2 | |
3 import java.util.concurrent.FutureTask; | |
4 | |
5 import org.apache.log4j.Logger; | |
6 | |
7 | |
8 /** | |
9 * This FutureTask overrides the <i>cancel()</i> method. Before super.cancel() | |
10 * is called, WSPLGENCallable.cancelWSPLGEN() is executed to kill a running | |
11 * WSPLGEN process. | |
12 * | |
13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
14 */ | |
15 public class WSPLGENFuture extends FutureTask { | |
16 | |
17 private static final Logger logger = Logger.getLogger(WSPLGENFuture.class); | |
18 | |
19 protected WSPLGENCallable wsplgenCallable; | |
20 | |
21 | |
22 public WSPLGENFuture(WSPLGENCallable callable) { | |
23 super(callable); | |
24 this.wsplgenCallable = callable; | |
25 } | |
26 | |
27 | |
28 public WSPLGENCallable getWSPLGENCallable() { | |
29 return wsplgenCallable; | |
30 } | |
31 | |
32 | |
33 @Override | |
34 public boolean cancel(boolean mayInterruptIfRunning) { | |
35 logger.debug("WSPLGENFuture.cancel"); | |
36 | |
37 wsplgenCallable.cancelWSPLGEN(); | |
38 return super.cancel(mayInterruptIfRunning); | |
39 } | |
40 } | |
41 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |