ingo@1970: package de.intevation.flys.wsplgen;
ingo@1970:
ingo@1970: import java.util.concurrent.FutureTask;
ingo@1970:
ingo@1970: import org.apache.log4j.Logger;
ingo@1970:
ingo@1970:
ingo@1970: /**
ingo@1970: * This FutureTask overrides the cancel() method. Before super.cancel()
ingo@1970: * is called, WSPLGENCallable.cancelWSPLGEN() is executed to kill a running
ingo@1970: * WSPLGEN process.
ingo@1970: *
ingo@1970: * @author Ingo Weinzierl
ingo@1970: */
ingo@1970: public class WSPLGENFuture extends FutureTask {
ingo@1970:
ingo@1970: private static final Logger logger = Logger.getLogger(WSPLGENFuture.class);
ingo@1970:
ingo@1970: protected WSPLGENCallable wsplgenCallable;
ingo@1970:
ingo@1970:
ingo@1970: public WSPLGENFuture(WSPLGENCallable callable) {
ingo@1970: super(callable);
ingo@1970: this.wsplgenCallable = callable;
ingo@1970: }
ingo@1970:
ingo@1970:
ingo@1970: public WSPLGENCallable getWSPLGENCallable() {
ingo@1970: return wsplgenCallable;
ingo@1970: }
ingo@1970:
ingo@1970:
ingo@1970: @Override
ingo@1970: public boolean cancel(boolean mayInterruptIfRunning) {
ingo@1970: logger.debug("WSPLGENFuture.cancel");
ingo@1970:
ingo@1970: wsplgenCallable.cancelWSPLGEN();
ingo@1970: return super.cancel(mayInterruptIfRunning);
ingo@1970: }
ingo@1970: }
ingo@1970: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :