Class ParallelTasksExecutor
- java.lang.Object
-
- com.atlassian.confluence.impl.backuprestore.ParallelTasksExecutor
-
- All Implemented Interfaces:
AutoCloseable
public class ParallelTasksExecutor extends Object implements AutoCloseable
Allows to multiple tasks in parallel. Creates a queue for tasks.- Since:
- 7.20
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static ParallelTasksExecutorcreate(int threadsNumber, String threadNamePrefix)static ParallelTasksExecutorcreate(BackupRestoreJob job, int threadsNumber)voidinterruptAllJobs()<T> Future<T>runTaskAsync(Callable<T> task, String info)voidwaitUntilAllJobsComplete()
-
-
-
Method Detail
-
create
public static ParallelTasksExecutor create(BackupRestoreJob job, int threadsNumber)
-
create
public static ParallelTasksExecutor create(int threadsNumber, String threadNamePrefix)
-
interruptAllJobs
public void interruptAllJobs()
-
waitUntilAllJobsComplete
public void waitUntilAllJobsComplete() throws ExecutionException, InterruptedException, TimeoutException
-
close
public void close() throws InterruptedException- Specified by:
closein interfaceAutoCloseable- Throws:
InterruptedException
-
-