Package com.unboundid.util
Class LDAPSDKThreadFactory
java.lang.Object
com.unboundid.util.LDAPSDKThreadFactory
- All Implemented Interfaces:
ThreadFactory
@Mutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class LDAPSDKThreadFactory
extends Object
implements 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
ConstructorsConstructorDescriptionLDAPSDKThreadFactory(String baseName, boolean daemon) Creates a new instance of this thread factory with the provided settings.LDAPSDKThreadFactory(String baseName, boolean daemon, ThreadGroup threadGroup) Creates a new instance of this thread factory with the provided settings. -
Method Summary
-
Constructor Details
-
LDAPSDKThreadFactory
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(@NotNull String baseName, boolean daemon, @Nullable 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 benullif the default thread group should be used.
-
-
Method Details
-
newThread
Creates a new thread using the settings for this thread factory. The new thread will not be started.- Specified by:
newThreadin interfaceThreadFactory- Parameters:
r- TheRunnabletarget that will be used for the actual thread logic. It must not benull.- Returns:
- The newly-created (but not yet started) thread.
-