Class ExecutorsFactory
- java.lang.Object
-
- jetbrains.buildServer.util.executors.ExecutorsFactory
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExecutorService
newDaemonExecutor(String threadNamePrefix)
Creates not fixed thread pool executor with daemon threads.static ExecutorService
newExecutor(String threadNamePrefix)
Creates not fixed thread pool executor with non daemon threads.static ExecutorService
newFixedDaemonExecutor(String threadNamePrefix, int poolSize)
Creates fixed thread pool executor of specified size with daemon threads.static ExecutorService
newFixedDaemonExecutor(String threadNamePrefix, int minPoolSize, int maxPoolSize, int maxQueueSize)
Creates thread pool executor with specified number of minimum and maximum daemon threads.static ExecutorService
newFixedExecutor(String threadNamePrefix, int poolSize)
Creates fixed thread pool executor of specified size with non daemon threads.static ScheduledExecutorService
newFixedScheduledDaemonExecutor(String threadNamePrefix, int poolSize)
Creates fixed scheduled thread pool executor of specified size with daemon threads.static ScheduledExecutorService
newFixedScheduledExecutor(String threadNamePrefix, int poolSize)
Creates fixed scheduled thread pool executor of specified size with non daemon threads.static ExecutorService
newSingleThreadedExecutor(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
-
-