Package jadx.core.utils.tasks
Class TaskExecutor
java.lang.Object
jadx.core.utils.tasks.TaskExecutor
- All Implemented Interfaces:
ITaskExecutor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable ExecutorServiceprivate final Objectprivate static final org.slf4j.Loggerprivate final AtomicIntegerprivate final AtomicBooleanprivate final List<TaskExecutor.ExecStage> private intprivate @Nullable Errorprivate final AtomicBooleanprivate final AtomicInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParallelTasks(List<? extends Runnable> parallelTasks) Add parallel stage with provided tasksvoidaddSequentialTask(Runnable seqTask) Add sequential stage with a single taskvoidaddSequentialTasks(List<? extends Runnable> seqTasks) Add sequential stage with provided tasksstatic voidawaitExecutorTermination(ExecutorService executor) voidBlock until execution is finishedvoidexecute()Start tasks execution.@Nullable ExecutorServiceReturn internal executor service.intintScheduled tasks countintbooleanbooleanprivate voidvoidsetThreadsCount(int count) Set threads count for parallel stage.private voidvoidNot started tasks will be not executed after this method invocation.private voidterminateWithError(Error error) private void
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
stages
-
threadsCount
-
progress
-
running
-
terminating
-
executorSync
-
executor
-
tasksCount
private int tasksCount -
terminateError
-
-
Constructor Details
-
TaskExecutor
public TaskExecutor()
-
-
Method Details
-
addParallelTasks
Description copied from interface:ITaskExecutorAdd parallel stage with provided tasks- Specified by:
addParallelTasksin interfaceITaskExecutor
-
addSequentialTasks
Description copied from interface:ITaskExecutorAdd sequential stage with provided tasks- Specified by:
addSequentialTasksin interfaceITaskExecutor
-
addSequentialTask
Description copied from interface:ITaskExecutorAdd sequential stage with a single task- Specified by:
addSequentialTaskin interfaceITaskExecutor
-
getThreadsCount
public int getThreadsCount()- Specified by:
getThreadsCountin interfaceITaskExecutor
-
setThreadsCount
public void setThreadsCount(int count) Description copied from interface:ITaskExecutorSet threads count for parallel stage. Can be changed during execution. Defaults to half of processors count.- Specified by:
setThreadsCountin interfaceITaskExecutor
-
getTasksCount
public int getTasksCount()Description copied from interface:ITaskExecutorScheduled tasks count- Specified by:
getTasksCountin interfaceITaskExecutor
-
getProgress
public int getProgress()- Specified by:
getProgressin interfaceITaskExecutor
-
execute
public void execute()Description copied from interface:ITaskExecutorStart tasks execution.- Specified by:
executein interfaceITaskExecutor
-
stopExecution
private void stopExecution() -
awaitTermination
public void awaitTermination()Description copied from interface:ITaskExecutorBlock until execution is finished- Specified by:
awaitTerminationin interfaceITaskExecutor
-
terminate
public void terminate()Description copied from interface:ITaskExecutorNot started tasks will be not executed after this method invocation.- Specified by:
terminatein interfaceITaskExecutor
-
terminateWithError
-
isTerminating
public boolean isTerminating()- Specified by:
isTerminatingin interfaceITaskExecutor
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceITaskExecutor
-
getInternalExecutor
Description copied from interface:ITaskExecutorReturn internal executor service.- Specified by:
getInternalExecutorin interfaceITaskExecutor
-
runStages
private void runStages() -
wrapTask
-
awaitExecutorTermination
-