annotate artifacts/src/main/java/org/dive4elements/river/wsplgen/WSPLGENFuture.java @ 7167:2fd238b681a9

Add debug output triggered by debugging the last commit
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 26 Sep 2013 12:22:01 +0200
parents af13ceeba52a
children e4606eae8ea5
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 1970
diff changeset
9 package org.dive4elements.river.wsplgen;
1970
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import java.util.concurrent.FutureTask;
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import org.apache.log4j.Logger;
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 /**
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 * This FutureTask overrides the <i>cancel()</i> method. Before super.cancel()
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 * is called, WSPLGENCallable.cancelWSPLGEN() is executed to kill a running
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 * WSPLGEN process.
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 *
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 */
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 public class WSPLGENFuture extends FutureTask {
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 private static final Logger logger = Logger.getLogger(WSPLGENFuture.class);
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 protected WSPLGENCallable wsplgenCallable;
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 public WSPLGENFuture(WSPLGENCallable callable) {
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 super(callable);
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 this.wsplgenCallable = callable;
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 }
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 public WSPLGENCallable getWSPLGENCallable() {
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 return wsplgenCallable;
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 }
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 @Override
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 public boolean cancel(boolean mayInterruptIfRunning) {
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 logger.debug("WSPLGENFuture.cancel");
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 wsplgenCallable.cancelWSPLGEN();
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 return super.cancel(mayInterruptIfRunning);
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 }
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 }
368040e5c400 Improved the Scheduler to be able to cancel running WSPLGEN jobs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org