Class ExecutorsFactory
- java.lang.Object
-
- jetbrains.buildServer.util.executors.ExecutorsFactory
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorServicenewDaemonExecutor(String threadNamePrefix)Creates not fixed thread pool executor with daemon threads.static ExecutorServicenewExecutor(String threadNamePrefix)Creates not fixed thread pool executor with non daemon threads.static ExecutorServicenewFixedDaemonExecutor(String threadNamePrefix, int poolSize)Creates fixed thread pool executor of specified size with daemon threads.static ExecutorServicenewFixedDaemonExecutor(String threadNamePrefix, int minPoolSize, int maxPoolSize, int maxQueueSize)Creates thread pool executor with specified number of minimum and maximum daemon threads.static ExecutorServicenewFixedExecutor(String threadNamePrefix, int poolSize)Creates fixed thread pool executor of specified size with non daemon threads.static ScheduledExecutorServicenewFixedScheduledDaemonExecutor(String threadNamePrefix, int poolSize)Creates fixed scheduled thread pool executor of specified size with daemon threads.static ScheduledExecutorServicenewFixedScheduledExecutor(String threadNamePrefix, int poolSize)Creates fixed scheduled thread pool executor of specified size with non daemon threads.static ExecutorServicenewSingleThreadedExecutor(String threadNamePrefix)Creates single-threaded pool executor with non daemon threads.
-
-
-
Method Detail
-
newFixedDaemonExecutor
@NotNull public static ExecutorService newFixedDaemonExecutor(@NotNull String threadNamePrefix, int poolSize)
Creates fixed thread pool executor of specified size with daemon threads.- Parameters:
threadNamePrefix- prefix for thread namespoolSize- size of the thread pool- Returns:
- new thread pool
- Since:
- 8.1.2
-
newFixedDaemonExecutor
@NotNull public static ExecutorService newFixedDaemonExecutor(@NotNull String threadNamePrefix, int minPoolSize, int maxPoolSize, int maxQueueSize)
Creates thread pool executor with specified number of minimum and maximum daemon threads. This executor also uses fixed size queue.- Parameters:
threadNamePrefix- thread name prefixminPoolSize- minimum number of threads to keep in poolmaxPoolSize- maximum number of threadsmaxQueueSize- maximum size of the queue- Returns:
- see above
- Since:
- 2018.2.1
-
newFixedExecutor
@NotNull public static ExecutorService newFixedExecutor(@NotNull String threadNamePrefix, int poolSize)
Creates fixed thread pool executor of specified size with non daemon threads.- Parameters:
threadNamePrefix- prefix for thread namespoolSize- size of the thread pool- Returns:
- new thread pool
- Since:
- 8.1.2
-
newFixedScheduledDaemonExecutor
@NotNull public static ScheduledExecutorService newFixedScheduledDaemonExecutor(@NotNull String threadNamePrefix, int poolSize)
Creates fixed scheduled thread pool executor of specified size with daemon threads.- Parameters:
threadNamePrefix- prefix for thread namespoolSize- size of the thread pool- Returns:
- new thread pool
- Since:
- 8.1.2
-
newFixedScheduledExecutor
@NotNull public static ScheduledExecutorService newFixedScheduledExecutor(@NotNull String threadNamePrefix, int poolSize)
Creates fixed scheduled thread pool executor of specified size with non daemon threads.- Parameters:
threadNamePrefix- prefix for thread namespoolSize- size of the thread pool- Returns:
- new thread pool
- Since:
- 8.1.2
-
newDaemonExecutor
@NotNull public static ExecutorService newDaemonExecutor(@NotNull String threadNamePrefix)
Creates not fixed thread pool executor with daemon threads.- Parameters:
threadNamePrefix- prefix for thread names- Returns:
- new thread pool
- Since:
- 8.1.2
-
newExecutor
@NotNull public static ExecutorService newExecutor(@NotNull String threadNamePrefix)
Creates not fixed thread pool executor with non daemon threads.- Parameters:
threadNamePrefix- prefix for thread names- Returns:
- new thread pool
- Since:
- 8.1.2
-
newSingleThreadedExecutor
@NotNull public static ExecutorService newSingleThreadedExecutor(@NotNull String threadNamePrefix)
Creates single-threaded pool executor with non daemon threads.
Similar toExecutors.newSingleThreadExecutor(), tasks are guaranteed to execute sequentially, and no more than one task will be active at any given time, unless number of threads is increased explicitly- Parameters:
threadNamePrefix- prefix for thread names- Returns:
- new thread pool
- Since:
- 2018.1
-
-