Class InterruptableExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
heros.solver.CountingThreadPoolExecutor
soot.jimple.infoflow.solver.executors.InterruptableExecutor
- All Implemented Interfaces:
Executor,ExecutorService
- Direct Known Subclasses:
SetPoolExecutor
public class InterruptableExecutor
extends heros.solver.CountingThreadPoolExecutor
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Field Summary
FieldsFields inherited from class heros.solver.CountingThreadPoolExecutor
exception, numRunningTasks -
Constructor Summary
ConstructorsConstructorDescriptionInterruptableExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidawaitCompletion(long timeout, TimeUnit unit) voidvoidInterrupts the executor.booleanGets whether this executor has terminated all of its tasksbooleanvoidreset()Resets the executor to allow for new tasks once all previous tasks have completed or after the executor has been interrupted.Methods inherited from class heros.solver.CountingThreadPoolExecutor
afterExecute, getExceptionMethods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
InterruptableExecutor
public InterruptableExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)
-
-
Method Details
-
interrupt
public void interrupt()Interrupts the executor. This will make the awaitCompletion() methods return immediately and silently reject all new tasks. -
reset
public void reset()Resets the executor to allow for new tasks once all previous tasks have completed or after the executor has been interrupted. -
execute
-
awaitCompletion
- Overrides:
awaitCompletionin classheros.solver.CountingThreadPoolExecutor- Throws:
InterruptedException
-
awaitCompletion
- Overrides:
awaitCompletionin classheros.solver.CountingThreadPoolExecutor- Throws:
InterruptedException
-
isFinished
public boolean isFinished()Gets whether this executor has terminated all of its tasks- Returns:
- True if this executor has terminated all of its tasks, otherwise false
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceExecutorService- Overrides:
isTerminatedin classThreadPoolExecutor
-