public class ThreadFactories extends Object
ThreadFactory instances.
All factory implementations produce named threads to give good stack-traces.| Modifier and Type | Class and Description |
|---|---|
static class |
ThreadFactories.Builder
Simple builder for
ThreadFactory instances |
static class |
ThreadFactories.Type |
| Modifier and Type | Method and Description |
|---|---|
static ThreadFactories.Builder |
named(String name)
Get a
ThreadFactories.Builder with the
required name prefix. |
static ThreadFactory |
namedThreadFactory(String name)
Get a
ThreadFactory with the required name
prefix. |
static ThreadFactory |
namedThreadFactory(String name,
ThreadFactories.Type type)
Get a
ThreadFactory with the required name
prefix and type (user or daemon). |
static ThreadFactory |
namedThreadFactory(String name,
ThreadFactories.Type type,
int priority)
Get a
ThreadFactory with the required name
prefix, type and priority. |
public static ThreadFactories.Builder named(String name)
ThreadFactories.Builder with the
required name prefix.name - threads will be named with this prefixThreadFactories.Builder that
can specify the parameters for type, priority etc.public static ThreadFactory namedThreadFactory(@NotNull String name)
ThreadFactory with the required name
prefix. The produced threads are user threads and have normal priority.name - the prefix to use for naming the threads.ThreadFactorypublic static ThreadFactory namedThreadFactory(@NotNull String name, @NotNull ThreadFactories.Type type)
ThreadFactory with the required name
prefix and type (user or daemon). The produced threads have normal
priority.name - the prefix to use for naming the threads.type - whether they are User or Daemon threads.ThreadFactorypublic static ThreadFactory namedThreadFactory(@NotNull String name, @NotNull ThreadFactories.Type type, int priority)
ThreadFactory with the required name
prefix, type and priority.name - the prefix to use for naming the threads.type - whether they are User or Daemon threads.priority - the thread priority, must not be lower than
Thread.MIN_PRIORITY or greater than
Thread.MAX_PRIORITYThreadFactoryCopyright © 2024 Atlassian. All rights reserved.