Package com.unboundid.util
Class LDAPSDKThreadFactory
- java.lang.Object
-
- com.unboundid.util.LDAPSDKThreadFactory
-
- All Implemented Interfaces:
java.util.concurrent.ThreadFactory
@Mutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class LDAPSDKThreadFactory extends java.lang.Object implements java.util.concurrent.ThreadFactory
This class provides a thread factory implementation that may be used to create threads with a number of basic settings. The name of each thread will be followed by a counter indicating the order in which the thread was created.
-
-
Constructor Summary
Constructors Constructor Description LDAPSDKThreadFactory(java.lang.String baseName, boolean daemon)
Creates a new instance of this thread factory with the provided settings.LDAPSDKThreadFactory(java.lang.String baseName, boolean daemon, java.lang.ThreadGroup threadGroup)
Creates a new instance of this thread factory with the provided settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Thread
newThread(java.lang.Runnable r)
Creates a new thread using the settings for this thread factory.
-
-
-
Constructor Detail
-
LDAPSDKThreadFactory
public LDAPSDKThreadFactory(java.lang.String baseName, boolean daemon)
Creates a new instance of this thread factory with the provided settings. Threads created will have the default thread group.- Parameters:
baseName
- The base name to use for threads created by this factory.daemon
- Indicates whether the threads should be created as daemon threads.
-
LDAPSDKThreadFactory
public LDAPSDKThreadFactory(java.lang.String baseName, boolean daemon, java.lang.ThreadGroup threadGroup)
Creates a new instance of this thread factory with the provided settings.- Parameters:
baseName
- The base name to use for threads created by this factory. It must not benull
.daemon
- Indicates whether the threads should be created as daemon threads.threadGroup
- The thread group to use for threads created by this factory. It may benull
if the default thread group should be used.
-
-
Method Detail
-
newThread
public java.lang.Thread newThread(java.lang.Runnable r)
Creates a new thread using the settings for this thread factory. The new thread will not be started.- Specified by:
newThread
in interfacejava.util.concurrent.ThreadFactory
- Parameters:
r
- TheRunnable
target that will be used for the actual thread logic. It must not benull
.- Returns:
- The newly-created (but not yet started) thread.
-
-