ThreadFactory
public class ThreadFactoryImpl extends Object implements ThreadFactory
ThreadFactoryImpl
implements the ThreadFactory
to be used
by an ExecutorService
. The ThreadFactoryImpl
is providing
additional means to set the priority of a thread or whether a is being
executed as a daemon thread; so that the threads can be configured as
required when being executed by an ExecutorService
.
Else there would be no means force threads to be executed as daemon threads
or with a required priority when executed by the ExecutorService
without such a dedicated ThreadFactory
.
Constructor | Description |
---|---|
ThreadFactoryImpl(boolean isDaemon) |
Constructs the
ThreadFactoryImpl with the given attributes. |
ThreadFactoryImpl(int aPriority) |
Constructs the
ThreadFactoryImpl with the given attributes. |
ThreadFactoryImpl(int aPriority,
boolean isDaemon) |
Constructs the
ThreadFactoryImpl with the given attributes. |
public ThreadFactoryImpl(int aPriority, boolean isDaemon)
ThreadFactoryImpl
with the given attributes.aPriority
- The priority to to set for the treadsisDaemon
- True in case the threads are to be executed as daemon
threads.public ThreadFactoryImpl(int aPriority)
ThreadFactoryImpl
with the given attributes.aPriority
- The priority to to set for the treadspublic ThreadFactoryImpl(boolean isDaemon)
ThreadFactoryImpl
with the given attributes.isDaemon
- True in case the threads are to be executed as daemon
threads.public Thread newThread(Runnable aRunnable)
newThread
in interface ThreadFactory
Copyright © 2018. All rights reserved.