Skip to content
Snippets Groups Projects
Commit 4598ad3b authored by brinn's avatar brinn
Browse files

change: - perform a major refactoring on TerminableCallable by putting the...

change: - perform a major refactoring on TerminableCallable by putting the thread guard stuff to a class of its own (ThreadGuard)
- ensure the TerminableCallable doesn't get started if it is cancelled or terminated before it starts running
- remove the hasCleanedUp() and waitForCleanedUp() methods
- remove the waitForStarted() method

SVN: 6653
parent f527e6d6
No related merge requests found
......@@ -18,7 +18,6 @@ package ch.systemsx.cisd.common.concurrent;
import java.util.concurrent.Future;
import ch.systemsx.cisd.common.concurrent.TerminableCallable.ICleaner;
import ch.systemsx.cisd.common.exceptions.StopException;
import ch.systemsx.cisd.common.utilities.ITerminable;
......@@ -36,15 +35,6 @@ public interface ITerminableFuture<V> extends Future<V>, ITerminable
*/
public boolean isRunning();
/**
* Waits for the task of the future to start running. The method waits at most
* <var>timeoutMillis</var> milli-seconds.
*
* @return <code>true</code>, if the task of the future has started running when the method
* returns.
*/
public boolean waitForStarted(long timeoutMillis) throws StopException;
/**
* Returns <code>true</code>, if the task of the future has already started running.
*/
......@@ -64,22 +54,6 @@ public interface ITerminableFuture<V> extends Future<V>, ITerminable
*/
public boolean hasFinished();
/**
* Waits for the task of the future to finish cleaning up. The method waits at most
* <var>timeoutMillis</var> milli-seconds.
*
* @return <code>true</code>, if the task of the future has finished cleaning up when the
* method returns.
*/
public boolean waitForCleanedUp(long timeoutMillis) throws StopException;
/**
* Returns <code>true</code>, if the task of the future has already called the
* {@link ICleaner#cleanUp(ch.systemsx.cisd.common.concurrent.TerminableCallable.FinishCause)}
* method, if any.
*/
public boolean hasCleanedUp();
/**
* Terminates the task of the future if it has already started running. If it has not yet
* started running, this method cancels it using {@link Future#cancel(boolean)}. Blocks until
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment