Uses of Interface
java.util.concurrent.ThreadFactory
Package
Description
Provides classes that are fundamental to the design of the Java
programming language.
Provides reference-object classes, which support a limited degree
of interaction with the garbage collector.
Defines channels, which represent connections to entities that are capable of
performing I/O operations, such as files and sockets; defines selectors, for
multiplexed, non-blocking I/O operations.
Service-provider classes for the
java.nio.channels
package.Utility classes commonly useful in concurrent programming.
Defines non-final APIs for concurrent programming.
-
Uses of ThreadFactory in java.lang
Modifier and TypeMethodDescriptionThread.Builder.factory()
Returns aThreadFactory
to create threads from the current state of the builder. -
Uses of ThreadFactory in java.lang.ref
Modifier and TypeMethodDescriptionstatic Cleaner
Cleaner.create
(ThreadFactory threadFactory) Returns a newCleaner
using aThread
from theThreadFactory
. -
Uses of ThreadFactory in java.nio.channels
Modifier and TypeMethodDescriptionstatic AsynchronousChannelGroup
AsynchronousChannelGroup.withFixedThreadPool
(int nThreads, ThreadFactory threadFactory) Creates an asynchronous channel group with a fixed thread pool. -
Uses of ThreadFactory in java.nio.channels.spi
Modifier and TypeMethodDescriptionabstract AsynchronousChannelGroup
AsynchronousChannelProvider.openAsynchronousChannelGroup
(int nThreads, ThreadFactory threadFactory) Constructs a new asynchronous channel group with a fixed thread pool. -
Uses of ThreadFactory in java.util.concurrent
Modifier and TypeMethodDescriptionstatic ThreadFactory
Executors.defaultThreadFactory()
Returns a default thread factory used to create new threads.ThreadPoolExecutor.getThreadFactory()
Returns the thread factory used to create new threads.static ThreadFactory
Executors.privilegedThreadFactory()
Deprecated, for removal: This API element is subject to removal in a future version.This method is only useful in conjunction with the Security Manager, which is deprecated and subject to removal in a future release.Modifier and TypeMethodDescriptionstatic ExecutorService
Executors.newCachedThreadPool
(ThreadFactory threadFactory) Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available, and uses the provided ThreadFactory to create new threads when needed.static ExecutorService
Executors.newFixedThreadPool
(int nThreads, ThreadFactory threadFactory) Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue, using the provided ThreadFactory to create new threads when needed.static ScheduledExecutorService
Executors.newScheduledThreadPool
(int corePoolSize, ThreadFactory threadFactory) Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.static ExecutorService
Executors.newSingleThreadExecutor
(ThreadFactory threadFactory) Creates an Executor that uses a single worker thread operating off an unbounded queue, and uses the provided ThreadFactory to create a new thread when needed.static ScheduledExecutorService
Executors.newSingleThreadScheduledExecutor
(ThreadFactory threadFactory) Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.static ExecutorService
Executors.newThreadPerTaskExecutor
(ThreadFactory threadFactory) Preview.Creates an Executor that starts a new Thread for each task.void
ThreadPoolExecutor.setThreadFactory
(ThreadFactory threadFactory) Sets the thread factory used to create new threads.ModifierConstructorDescriptionScheduledThreadPoolExecutor
(int corePoolSize, ThreadFactory threadFactory) Creates a newScheduledThreadPoolExecutor
with the given initial parameters.ScheduledThreadPoolExecutor
(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) Creates a newScheduledThreadPoolExecutor
with the given initial parameters.ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory) Creates a newThreadPoolExecutor
with the given initial parameters and the default rejected execution handler.ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) Creates a newThreadPoolExecutor
with the given initial parameters. -
Uses of ThreadFactory in jdk.incubator.concurrent
ModifierConstructorDescriptionShutdownOnFailure
(String name, ThreadFactory factory) Constructs a newShutdownOnFailure
with the given name and thread factory.ShutdownOnSuccess
(String name, ThreadFactory factory) Constructs a newShutdownOnSuccess
with the given name and thread factory.StructuredTaskScope
(String name, ThreadFactory factory) Creates a structured task scope with the given name and thread factory.